Self Hosted Gatsby SPA + NGINX env vars

I am self hosting my Gatsbyjs site and serving it via NGINX.
I get the error ‘domain option is required’ on initial load of index.html.

What I don’t understand is, I have a .env.production file with my AUTH0_DOMAIN and AUTH0_CLIENTID set which should be referenced at build time. Why am I getting this error?

Thanks in advance!