Working on a client\'s server where there are two different versions of nginx installed. I think one of them was installed with the brew package manager (its an osx box) and the
which nginx
will give you the path of the nginx being used
EDIT (2017-Jan-18)
Thanks to Will Palmer's comment on this answer, I have added the following...
If you've installed nginx via a package manager such as HomeBrew...
which nginx
may not give you the EXACT path to the nginx being used. You can however find it using
realpath $(which nginx)
and as mentioned by @Daniel Li
you can get configuration of nginx via his method
alternatively you can use this:
nginx -V