Nginx reload problem
Maxim Dounin
mdounin at mdounin.ru
Sat Aug 17 02:09:29 UTC 2013
Hello!
On Thu, Aug 15, 2013 at 11:07:30PM +0800, li zJay wrote:
> Hello:
>
> I found that some nginx config option doesn't take effect after
> modification with reload, the following is a simple test case:
>
> nginx version: nginx/1.2.7
> nginx.conf:
> ============================
> worker_processes 1;
> error_log logs/error.log info;
>
> events {
> worker_connections 1024;
> }
>
> http {
> limit_req_zone $arg_a zone=testzone:64m rate=1r/s;
>
> server {
> listen 80;
>
> location / {
> limit_req zone=testzone burst=2;
> alias /;
> }
> }
> }
> ============================
>
> I change $arg_a to $arg_b in the line 'limit_req_zone $arg_a
> zone=testzone:64m rate=1r/s;' then reload nginx, but the change doesn't
> take effect, unless I stop nginx manually and start it again.
>
> Is this an expected behavior ? or are there any other nginx config options
> that not compatible with reload operation?
It's expected behaviour. On such reload attempt, nginx will write
something like:
... [emerg] ... limit_req "testzone" uses the "arg_b" variable while previously it used the "arg_a" variable
into error log, explaining why it failed to load new
configuration.
--
Maxim Dounin
http://nginx.org/en/donation.html
More information about the nginx
mailing list