I was reading this question on the Physics Stack Exchange, and I'm still not quite sure how I can understand the relationship between locality and local gauge invariance using this example. Consider the Lagrangian density for the electromagnetic field $A_\mu$, coupled to a complex scalar field $\phi$: \begin{equation*} \mathcal{L}_{{\rm gauge}} = -\frac{1}{4}F_{\mu\nu}F^{\mu\nu}+(D_\mu\phi)^*D^\mu\phi, \end{equation*} where $D_\mu = \partial_\mu-iqA_\mu$, and $F_{\mu\nu} = \partial_\mu A_\nu-\partial_\nu A_\mu$. Is it right to say the local gauge invariance $\phi\rightarrow e^{i\theta(x)}\phi$ preserves the Lagrangian density $\mathcal{L}_{{\rm gauge}}$, which makes the corresponding action local, therefore the field theory is local?
I think I don't quite understand how we define 'locality' in the context of field theory. Also for this example, are we assuming local gauge invariance, instead of global symmetries?