I am trying to use X-Accel to pass information about the request to the internally redirected uri.
location / {
root /web/external;
include fastcgi.conf;
fastcgi_param SCRIPT_FILENAME $document_root/check.php;
fastcgi_pass unix:/services/.sock/fastcgi.sock;
}
location /internal/ {
internal;
alias /web/internal;
include fastcgi.conf;
fastcgi_param SCRIPT_FILENAME $document_root/app.php;
fastcgi_pass unix:/services/.sock/fastcgi.sock;
}
The check.php returns an X-Accel-Redirect header to /internal/$uri and also sends other header values that i would like to pass over to the internal request. I have tried to access the headers using $sent_header_* but it doesn’t seem to work.
I found a 3rd party module that seems to fit my use case more closely. Though I wish it was something I could find “built in”
ngx_http_auth_request_module
http://mdounin.ru/hg/ngx_http_auth_request_module/file/tip/README
http://mdounin.ru/hg/ngx_http_auth_request_module/file/tip/t/auth-request-set.t
The config would be changed to be like: