Welcome! Log In Create A New Profile

Advanced

Set Incoming Request Headers (similar to mod_headers)

W. Andrew Loe III
November 17, 2009 02:44PM
I am trying to emulate an Apache mod_headers feature
(http://httpd.apache.org/docs/2.2/mod/mod_headers.html#requestheader).
I would like to set some headers before my content handler is run.
Specifically SSL related headers that I would like set before my
Passenger process picks up the request. I could do this with
proxy_set_header, but I am not proxying, the request is being picked
up and executed by Passenger.

Config looks like this:

location / {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Client-Verify $ssl_client_verify;
proxy_set_header X-Client-DN $ssl_client_i_dn;
proxy_set_header X-SSL-Subject $ssl_client_s_dn;
proxy_read_timeout 75;

passenger_enabled on;
}

This however will not work, the headers are not set when the backend
runs. Do I need to setup a second server block listening on a
different port and then proxy the request to that so I can take
advantage of proxy_set_header, or is there a way to do it like Apache.
Subject Author Posted

Set Incoming Request Headers (similar to mod_headers)

W. Andrew Loe III November 17, 2009 02:44PM

Re: Set Incoming Request Headers (similar to mod_headers)

agentzh November 18, 2009 03:02AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 40
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready