include_shell

Alistair Prestidge alistair.prestidge at smithhotels.com
Tue Aug 23 14:32:29 UTC 2011


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 at 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 at nginx.org
> http://mailman.nginx.org/**mailman/listinfo/nginx<http://mailman.nginx.org/mailman/listinfo/nginx>
>



-- 
*
Thanks

Alistair Prestidge*

*
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20110823/f0b567d0/attachment.html>


More information about the nginx mailing list