Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

How do I get nginx to use a different config file on boot?

$
0
0
I posted this on askubuntu.com and someone told me that this is the best place to post so reposting here:

I'm trying to do something that I consider fairly simple... When Ubuntu boots, I want to start nginx using a config in a non-standard location (e.g. /home/ubuntu/foo/nginx.conf)

I've just installed that latest nginx (1.10.1) and I notice that it starts on boot and if I do "ps ax | grep nginx" I get a list of a bunch of worker process.

I haven't been able to find any standard way for it to not use its default config in /etc/nginx/nginx.conf

I could copy the contents of my .conf file into the standard .conf file and that would solve the problem. I don't what to do that because mine is in source control in its location and it will be updated now and then.

I was thinking of adding an @reboot entry to crontab to stop nginx and then start it with the -c param so that it would pickup my config. However that feels like the wrong solution. i.e. 1. allow Ubuntu to start nginx 2. shut it down 3. restart it with a different config.

Anyone know the answer to this?

(Ubuntu 14.04)

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>