Dynamic config options from ENV

Maximilian Schulz namxam at gmail.com
Thu Jun 5 16:50:10 UTC 2014

Thank you Jonathan,

I was afraid that this is the only option… really sad :(

I am currently experimenting with docker and dynamic setups which work for
all environments… too bad that we need to use a custom script do handle the
problem at hand. But thank you very much.


On Thu, Jun 5, 2014 at 6:21 PM, Jonathan Matthews <contact at jpluscplusm.com>

> On 5 June 2014 17:00, Maximilian Schulz <namxam at gmail.com> wrote:
> > Hi everybody,
> >
> > is it possible to set a nginx config variable from an ENV variable? I
> tried
> > several thing, but none of them worked. The most promising was specifying
> > "env MY_VAR;" at the top of the nginx.conf and then using its value via
> > "my_option $ENV{"MY_VAR"};". But it didn't work. I always got an error
> about
> > the line not being terminated.
> >
> > 1. Is it possible to set a config option via ENV varaibles
> > 2. If so, does it have any performance implications? (The ENV wont change
> > during run time)
> You can't do this nicely with nginx. Your best option is to
> pre-process the config file each time you reload/etc, interpolating
> the envvars so that nginx itself sees static values.
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20140605/b49f8fb9/attachment.html>

More information about the nginx mailing list