]> git.kaiwu.me - nginx.git/commitdiff
Fixed proxy_redirect off inheritance.
authorValentin Bartenev <vbart@nginx.com>
Mon, 30 Jan 2012 11:22:56 +0000 (11:22 +0000)
committerValentin Bartenev <vbart@nginx.com>
Mon, 30 Jan 2012 11:22:56 +0000 (11:22 +0000)
Example configuration to reproduce:

  server {
      proxy_redirect off;

      location / {
          proxy_pass http://localhost:8000;
          proxy_redirect http://localhost:8000/ /;

          location ~ \.php$ {
              proxy_pass http://localhost:8000;
              # proxy_redirect must be inherited from the level above,
              # but instead it was switched off here
          }
      }
  }

src/http/modules/ngx_http_proxy_module.c

index 009f9c4f2e42ec48c60019c486704d2485326b82..fb86f010682429131a524d25c04227f4d93eeddf 100644 (file)
@@ -3292,6 +3292,8 @@ ngx_http_proxy_redirect(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
         return NGX_CONF_OK;
     }
 
+    plcf->redirect = 1;
+
     value = cf->args->elts;
 
     if (cf->args->nelts == 2) {