赞
踩
ps aux|grep nginx
root 66635 0.0 0.0 13136 1148 pts/0 S+ 00:05 0:00 grep --color=auto nginx
root 88067 0.0 0.3 134172 6552 ? Ss Sep08 0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_p
nginx的路径为:/usr/sbin/nginx
使用nginx的 -t
参数进行配置检查,即可知道实际调用的配置文件路径及是否调用有效。
/usr/sbin/nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
测试可知,nginx的配置文件路径为:/etc/nginx/nginx.conf 且调用有效。
nginx 的配置很灵活,支持include
配置文件,如果配置内容过多, 这个文件就会比较乱, 也影响管理和阅读.所以直接拆分出来,分成不同的配置文件;怎么实现呢 ?直接include:
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites/pstest.conf;
所以,如果在主配置文件里找不到想要的配置信息,可以看看是否include其他配置文件;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。