mac 的 nginx 配置读哪的

2015-03-10 13:40:01 +08:00
 coolicer
好像从这里读,/usr/local/conf/nginx.conf
而我配置的是/usr/local/etc/nginx/nginx.conf ,然后个人的再新建了conf.d,放default.conf。

怎么让它读我的配置
1780 次点击
所在节点    问与答
7 条回复
Tink
2015-03-10 13:59:49 +08:00
ln -s
Havee
2015-03-10 14:07:10 +08:00
看 nginx 编译两进制时的选项 --conf-path=...
终端下运行 nginx -V 就一目了然了

至于改 conf 路径的话,在默认的 conf 中 include path/file 即可,至于用在 conf 文件的 server、http 还是 location 中,看具体需求
coolicer
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
2015-03-10 14:28:09 +08:00
@coolicer 终端运行 nginx -V
coolicer
2015-03-10 14:29:57 +08:00
上面贴的就是./nginx -V的结果
keithellis
2015-03-10 14:33:43 +08:00
OS X 默认就是 /usr/local/etc/nginx/nginx.conf,想手动指定配置文件用 nginx -c。
coolicer
2015-03-10 14:35:43 +08:00
@keithellis 但我运行nginx -t,usr/local/conf/nginx.conf 显示的是这个。然后最后我去这里配置了,然后也懒得新建,在上面加一个。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/175795

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX