nginx config file not updating after reload

孤人 提交于 2020-12-07 10:11:30

问题


I have a list of rewrite redirects in my nginx config file. There is one redirect that I'm trying to remove without any joy:

rewrite ^/bla/screening-tools$ /bla permanent;

I've tried simply removing this line, and then running

sudo nginx -s reload

However it is still there. I've tried leaving it in and then rewriting it once more at the end:

rewrite ^/bla/screening-tools$ /bla/screening-tools permanent;

However once more after reloading nginx this still has no effect. Am I missing something obvious? Do I need to manually stop and restart nginx?

Thanks in advance


回答1:


If your new configuration fails, it will use the old configuration. Can you check your error logs to see if the new configuration is successful? If it is reconfiguring, you should see a [notice] 1#1: reconfiguring note, and if it successfully reconfigured, you should see the old workers gracefully shutting down, like [notice] 7#7: gracefully shutting down. If it fails, you may see some [emerg] message.

Also, another thing you may want to try is adding nginx -s reload -c /path/to/nginx.conf to make sure it is reading the right file.



来源:https://stackoverflow.com/questions/46930089/nginx-config-file-not-updating-after-reload

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!