V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
coolicer
V2EX  ›  问与答

mac 的 nginx 配置读哪的

  •  
  •   coolicer · 2015-03-10 13:40:01 +08:00 · 1778 次点击
    这是一个创建于 3328 天前的主题,其中的信息可能已经有所发展或是发生改变。
    好像从这里读,/usr/local/conf/nginx.conf
    而我配置的是/usr/local/etc/nginx/nginx.conf ,然后个人的再新建了conf.d,放default.conf。

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

    至于改 conf 路径的话,在默认的 conf 中 include path/file 即可,至于用在 conf 文件的 server、http 还是 location 中,看具体需求
    coolicer
        3
    coolicer  
    OP
       2015-03-10 14:27:30 +08:00
    @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
    Havee
        4
    Havee  
       2015-03-10 14:28:09 +08:00   ❤️ 1
    @coolicer 终端运行 nginx -V
    coolicer
        5
    coolicer  
    OP
       2015-03-10 14:29:57 +08:00
    上面贴的就是./nginx -V的结果
    keithellis
        6
    keithellis  
       2015-03-10 14:33:43 +08:00
    OS X 默认就是 /usr/local/etc/nginx/nginx.conf,想手动指定配置文件用 nginx -c。
    coolicer
        7
    coolicer  
    OP
       2015-03-10 14:35:43 +08:00
    @keithellis 但我运行nginx -t,usr/local/conf/nginx.conf 显示的是这个。然后最后我去这里配置了,然后也懒得新建,在上面加一个。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   940 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 20:02 · PVG 04:02 · LAX 13:02 · JFK 16:02
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.