Welcome! Log In Create A New Profile

Advanced

Re: Possible to normalize headers in nginx?

Victor Iggy
August 07, 2009 11:28PM
I actually figured out my answer... the configuration is a bit weird but
it works...

is the answer... for anyone who cares.

location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For
$proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;

if ($http_accept_encoding ~ deflate) {
set $normal_encoding "deflate";
proxy_pass http://72.11.142.91:7999;
break;
}
if ($http_accept_encoding ~ gzip) {
set $normal_encoding "gzip";
proxy_pass http://72.11.142.91:7999;
break;
}
if ($request_uri ~
"\.(jpeg|jpg|png|gif|gz|tgz|bz2|tbz|mp3|ogg|ico|swf|mp4|flv|mov|dmg|mkv)")
{
set $normal_encoding "";
proxy_pass http://72.11.142.91:7999;
break;
}
proxy_set_header Accept-Encoding $normal_encoding;

}
--
Posted via http://www.ruby-forum.com/.
Subject Author Posted

Possible to normalize headers in nginx?

Victor Iggy August 07, 2009 10:01PM

Re: Possible to normalize headers in nginx?

Victor Iggy August 07, 2009 11:28PM

Re: Possible to normalize headers in nginx?

Igor Sysoev August 08, 2009 03:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 165
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready