Welcome! Log In Create A New Profile

Advanced

Re: include_shell

Alistair Prestidge
August 23, 2011 10:34AM
My usecase is as follows

We have production, staging and several dev environments configured on
different machines and we add development environments on a semi regular
basis.

At the moment I have to create individual nginx conf files for each
environment. Which is not hard but can be time consuming even the slightest
edit on one of the files means I have to go though
every config on every server and make the changes. Again not difficult but
time consuming.

What I would Ideally like is one file. A bash file that I can commit to my
code base.
This file can than figure out directory names and any specific config
settings that are needed for the specific environment.
For instance we set the following to be different depending on the
environment type.

fastcgi_param SITE_CONFIG dev;

If I could generate this all on the fly from a bash script I would only ever
need to do

include_shell /var/www/site.com/site-nginx.conf

There would be no other setup for nginx. The bash script would handle
everything else any changes made to the script would just require a "svn up"
followed by a reload.

Hope that makes sense.

Alistair


On 21 August 2011 23:37, Piotr Karbowski <jabberuser@gmail.com> wrote:

> On 21.08.2011 21:16, Alistair Prestidge wrote:
>
>> Hi
>>
>> I am pretty new to nginx I have been searching around to find if there is
>> a similar option like include_shell that lighttpd has
>> to use shell scripts to auto generate conf files.
>>
>> It appears that there is no such option, I have searched the mailing lists
>> and documentation. Is there a reason this has not been
>> implemented? are there any feature plans to implement this?
>>
>
> If you really need such feature I bet you can cover it with small shell
> script along with a function to re-generate config before you start or
> reload nginx.
>
> I am curious about your usecase, where you may need such thing?
>
> -- Piotr.
>
>
> ______________________________**_________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/**mailman/listinfo/nginxhttp://mailman.nginx.org/mailman/listinfo/nginx
>



--
*
Thanks

Alistair Prestidge*

*
*
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

include_shell

Alistair Prestidge August 21, 2011 03:18PM

Re: include_shell

Ensiferous August 21, 2011 06:02PM

Re: include_shell

Piotr Karbowski August 21, 2011 06:40PM

Re: include_shell

Alistair Prestidge August 23, 2011 10:34AM

Re: include_shell

Brane F. Gračnar August 23, 2011 10:58AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 215
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready