Locate the nginx.conf file my nginx is actually using

前端 未结 6 1467
南方客
南方客 2021-01-29 23:57

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

6条回答
  •  时光说笑
    2021-01-30 00:13

    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
    

提交回复
热议问题