coolicer
V2EX  ›  问与答

mac 的 nginx 配置读哪的

  •  
  •   coolicer · Mar 10, 2015 · 2323 views
    This topic created in 4127 days ago, the information mentioned may be changed or developed.
    好像从这里读,/usr/local/conf/nginx.conf
    而我配置的是/usr/local/etc/nginx/nginx.conf ,然后个人的再新建了conf.d,放default.conf。

    怎么让它读我的配置
    7 replies    2015-03-10 14:35:43 +08:00
    Tink
        1
    Tink  
    PRO
       Mar 10, 2015 via iPhone
    ln -s
    Busy
        2
    Busy  
       Mar 10, 2015
    看 nginx 编译两进制时的选项 --conf-path=...
    终端下运行 nginx -V 就一目了然了

    至于改 conf 路径的话,在默认的 conf 中 include path/file 即可,至于用在 conf 文件的 server、http 还是 location 中,看具体需求
    coolicer
        3
    coolicer  
    OP
       Mar 10, 2015
    @Havee
    nginx version: nginx/1.7.7
    built by clang 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
    TLS SNI support enabled
    configure arguments: --prefix=/usr/local --with-cc-opt=-Wno-deprecated-declarations --with-http_ssl_module --with-pcre=../pcre-8.36
    昨晚网上找的,好像没有conf-path
    Busy
        4
    Busy  
       Mar 10, 2015   ❤️ 1
    @coolicer 终端运行 nginx -V
    coolicer
        5
    coolicer  
    OP
       Mar 10, 2015
    上面贴的就是./nginx -V的结果
    keithellis
        6
    keithellis  
       Mar 10, 2015
    OS X 默认就是 /usr/local/etc/nginx/nginx.conf,想手动指定配置文件用 nginx -c。
    coolicer
        7
    coolicer  
    OP
       Mar 10, 2015
    @keithellis 但我运行nginx -t,usr/local/conf/nginx.conf 显示的是这个。然后最后我去这里配置了,然后也懒得新建,在上面加一个。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3040 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 108ms · UTC 08:55 · PVG 16:55 · LAX 01:55 · JFK 04:55
    ♥ Do have faith in what you're doing.