i have installed nginx in ubuntu16.04, and check that Configuration file location is /etc/nginx/conf/nginx.conf
$ /usr/sbin/nginx -V 2>&1 | grep --colour=auto conf
then Show Configuration file path:
--conf-path=/etc/nginx/nginx.conf
I am working on Install openam nginx Webagent link, this nginx_agent have one nginx.conf file
nginx_web_agent install path:
/opt/nginx_agent
nginx_web_agent nginx.conf path:
/opt/nginx_agent/conf/nginx.conf
nginx_web_agent use that nginx.conf file,
How can i change nginx default nginx.conf file to nginx_web_agent nginx.conf file
for example:
nginx Configure use /opt/nginx_agent/conf/nginx.conf instead of /etc/nginx/nginx.conf
Suggest me How can i do that?
Best Answer
/usr/sbin/nginx -V
shows the initial configure script parameters, not necessarily the actual parameters that are running.To use an alternative configuration file, instead on the default one, you can set the
-c
flag (man nginx) :Ubuntu 16.04 uses
systemd
to manage services, so you will need to changesystemd
parameters fornginx
service :/lib/systemd/system/nginx.service
Add
-c
flag where required :Reload the
systemd
manager configuration :systemctl daemon-reload
Start
nginx
service :Check
nginx
service parameters :This is the way i would do it.