Possible to normalize headers in nginx?

Victor Iggy lists at ruby-forum.com
Sat Aug 8 06:01:01 MSD 2009

I have the following set to normalize Accept-Encoding headers for squid
which sits down stream.

However, I am getting an issue with the following error...

[emerg]: "proxy_set_header" directive is not allowed here in
configuration file /opt/extra/nginx/conf/nginx-master.conf test failed

Am I out of luck when it comes to normalizing http headers with nginx?

    server {
        listen       3000;
        server_name  localhost;

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

            if ($http_accept_encoding ~ deflate) {
                proxy_set_header Accept-Encoding deflate;
            if ($http_accept_encoding ~ gzip) {
                proxy_set_header Accept-Encoding gzip;
            if ($request_uri ~
                proxy_set_header Accept-Encoding "";

Posted via http://www.ruby-forum.com/.

More information about the nginx mailing list