Possible to normalize headers in nginx?

Victor Iggy lists at ruby-forum.com
Sat Aug 8 07:28:36 MSD 2009


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/.





More information about the nginx mailing list