Welcome! Log In Create A New Profile

Advanced

handling x_forwarded_proto with Nginx as backend to HAproxy

April 15, 2013 05:35PM
Running Nginx 1.2.7 behind HAproxy, with SSL being terminated on on HAproxy. I was using the X_FORWARDED_PROTO header to make some decisions on the backend when I was using Apache, but it doesn't look like Nginx is handling the header currently:

client sent invalid header line: "X_FORWARDED_PROTO: http" while reading client request headers,

I found an old thread that seemed to address this, with Igor suggesting to use:

http {
map $http_x_forwarded_proto $my_https {
default off;
https on;
}

server {
...
location {
...;
fastcgi_param HTTPS $my_https;
}
}

but this doesn't seem to be carrying the header forward. Maybe it's a lack of understanding on my part or maybe the way the issue is handled has changed in the years since that post (HERE: http://osdir.com/ml/nginx/2010-05/msg00101.html), but if anyone has a suggestion I would appreciate it.
SubjectAuthorPosted

handling x_forwarded_proto with Nginx as backend to HAproxy

jaychrisApril 15, 2013 05:35PM

Re: handling x_forwarded_proto with Nginx as backend to HAproxy

Francis DalyApril 15, 2013 05:44PM

Re: handling x_forwarded_proto with Nginx as backend to HAproxy

jaychrisApril 15, 2013 06:03PM

Re: handling x_forwarded_proto with Nginx as backend to HAproxy

Maxim DouninApril 15, 2013 06:08PM

Re: handling x_forwarded_proto with Nginx as backend to HAproxy

Francis DalyApril 16, 2013 04:14AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 66
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 184 on July 08, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready