Sharing config between two sites

Daniel15 nginx-forum at
Tue Jun 12 04:02:13 UTC 2012

I've got two sites, and The configuration
for these two sites is almost identical, except for the root directory
(/var/www/sitename/live/public/ for the first domain, and
/var/www/sitename/beta/public/ for the second domain) and a few
environment variables (database name, etc.) used by the code. What's the
best way to share as much of the Nginx configuration as possible between
the two sites? Should I pull the common settings into an include file
and include it in both of the server blocks, or is there a better way?


 - Daniel

Posted at Nginx Forum:,227445,227445#msg-227445

More information about the nginx mailing list