0

I am working on a web application that will be deployed in a few environments (production, staging, dev, demo). In all of these environments I want to use nginx as a proxy. This means that nginx should be configured in pretty much the same way everywhere but with some differences such as server name. I would like to be able to re-use the same base configuration file for all environments and just provide the different variables from somewhere else.

Preferably the variables would come from some other file which would make it possible for me to put all configuration files into source control and just create symlinks on the servers pointing to their specific configuration file. Is this possible or is there another good solution for my problem?

2
  • What about creating a template and use sed or similar tool to parse the template and substitute the template variable to produce an nginx conf file before running nginx?
    – hookenz
    Mar 16, 2015 at 18:34
  • That would surely be possible. But if there is a built in solution into nginx I think I would prefer that. Mar 16, 2015 at 18:35

1 Answer 1

0

Don't try to solve this at nginx's level : go for some automation tool like puppet, chef, ansible etc.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .