1

RFC 3875 specifies a Local Redirect Response, which, in short says:

If the script sends a "Location:" header with a local path (i.e. starting with /, not with a protocol) and a Status Code 200 header, then the web server should interpret and fulfil this request as if the client had requested the file specified by the "Location:" header.

This works in Apache with the (now deprecated/hard to find mod_fastcgi) and in lighttpd, but not in Apache mod_fcgid.

I couldn't find any information about that for nginx.

Stefan S
  • 33
  • 4

1 Answers1

2

Nginx doesn't support this. But you could use X-Accel-Redirect header for internal redirect

X-Accel-Redirect: /location

http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_ignore_headers

“X-Accel-Redirect” performs an internal redirect to the specified URI;

Alexey Ten
  • 8,435
  • 1
  • 34
  • 36
  • Thanks. It's annoying that there is a standard but it's not fully implemented and instead we have to rely on proprietary headers. – Stefan S Oct 14 '19 at 12:39