We use baryon acoustic oscillation and redshift space distortion from the completed Baryon Oscillation Spectroscopic Survey, corresponding to Data Release 12 of the Sloan Digital Sky Survey, combined sample analysis in combination with cosmic microwave background, supernova, and redshift space distortion measurements from additional spectroscopic surveys to test deviations from general relativity. We present constraints on several phenomenological models of modified gravity: First, we parametrize the growth of structure using the growth index γ, finding γ = 0.566 ± 0.058 (68 per cent C.L.). Secondly, we modify the relation of the two Newtonian potentials by introducing two additional parameters, GM and GL. In this approach, GM refers to modifications of the growth of structure whereas GL to modification of the lensing potential. We consider a power law to model the redshift dependence of GM and GL as well as binning in redshift space, introducing four additional degrees of freedom, GM(z < 0.5), GM(z > 0.5), GL(z < 0.5), and GL(z > 0.5). At 68 per cent C.L., we measure GM = 0.980 ± 0.096 and GL = 1.082 ± 0.060 for a linear model, GM = 1.01 ± 0.36 and GL = 1.31 ± 0.19 for a cubic model as well as GM(z < 0.5) = 1.26 ± 0.32, GM(z > 0.5) = 0.986 ± 0.022, GL(z < 0.5) = 1.067 ± 0.058, and GL(z > 0.5) = 1.037 ± 0.029. Thirdly, we investigate general scalar tensor theories of gravity, finding the model to be mostly unconstrained by current data. Assuming a one-parameter f(R) model, we can constrain B0 < 7.7 × 10−5 (95 per cent C.L). For all models we considered, we find good agreement with general relativity.