X-Accel-Redirect not redirecting to named locaiton

latha nginx-forum at forum.nginx.org
Wed Jul 1 01:19:40 UTC 2020


I have the below config, calling /v2/test/status calls the
http://test.svc.cluster.local:9080/status.  But the named location `acreate`
is not being called. http://test.svc.cluster.local:9080/status  does return
`X-Accel-Redirect: @acreate` in response header.

location @acreate {
    internal;
    return 200 "testing";
   
   }

location ~ /v2/test(.*)$ {
      proxy_method GET;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header content-type "application/json";
      proxy_set_header Host $host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-NginX-Proxy true;
      set $serv  http://test.svc.cluster.local:9080$1;
      proxy_pass  $serv;
}

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,288509,288509#msg-288509



More information about the nginx mailing list