一、关闭缓存加载,不需要每次reload重启,但这只是修改关联的lua文件有效,修改nginx.conf还是需要重启
在http段放入配置项
lua_code_cache off;
二、配置Nginx的启动用户,在mac上需要加后面的组,linux上后面的组可以省略
nginx: [emerg] getgrnam("root") failed in /Users/a/Desktop/financial_report/nginx.conf:1
解决方法:
user gao staff;
自己的用户,默认为用户名+组
user root wheel;
root用户
三、设置启动路径和加载的配置文件
nginx -s reload -p `pwd`/ -c nginx.conf
-p 为启动目录, -c为配置文件路径,两者联合就是当前目录下的nginx.conf配置文件,-s stop/reload 重启停止,还可以-t 检测配置文件语法