5

I am trying to install Phusion Passenger module for Nginx. There was Nginx installed in /usr/sbin/nginx. The installer gem downloaded Nginx sources and compiled them with Passenger support into /opt/nginx/sbin/nginx. I copied this file into /usr/sbin/nginx.

So currently I am in doubt which Nginx is running and which config file I should edit.

Is there some way to determine the location of actually used Nginx and which configuration file does it use?

10

You shall be able to see the master process:

florin@vm:~$ ps aux | grep nginx
root       884  0.0  0.0  76944  1308 ?        Ss   10:28   0:00 nginx: master process /usr/sbin/nginx

The execute:

$ /usr/sbin/nginx -V 2>&1 | grep --colour=auto conf

It shall give you a --conf-path=/etc/nginx/nginx.conf somewhere around there.

2
~# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.