Nginx password protect one domain and avoid config duplication

Posted by gansbrest on Server Fault See other posts from Server Fault or by gansbrest
Published on 2011-11-22T22:10:39Z Indexed on 2011/11/23 1:57 UTC
Read the original article Hit count: 529

Filed under:
|

I got 2 domains dev.domain.com and beta.domain.com. At the moment I have one server section (default) with a bunch of specific locations and rules. Now I need to password protect beta.domain.com. Is there a way to do this without creating additional server section and essentially duplicating all my location and other rules?

Generally I would like to know how other people manage complex nginx configurations. Do they just copy sections (duplicate) or include common rules somehow?

© Server Fault or respective owner

Related posts about nginx

Related posts about config