We study global maximal regularity estimates for elliptic equations with variable exponents and degenerate matrix-valued weights in nonsmooth domains. 
We establish an optimal global $W^{1,p(\cdot)}_{\omega(\cdot)}$ estimate under the condition that both the degenerate matrix weight and variable exponent satisfy some vanishing conditions, while the domain is sufficiently flat in the Reifenberg sense that the boundary of the domain is locally trapped between two narrow strips.