header with underscore

Daniele Melosi ml at melosi.it
Thu Jan 27 11:41:39 MSK 2011


Hi all,

when proxy from nginx, if the headers contains underscore it won't be
passed:
$ curl -s http://proxy01.ced:8888/check_headers.php --header "Host:
myhost" --header "X_UP_CALLING_LINE_ID: daniele" | grep daniele

$ curl -s http://proxy01.ced:8888/check_headers.php --header "Host:
myhost" --header "X-UP-CALLING-LINE-ID: daniele" | grep daniele
    [HTTP_X_UP_CALLING_LINE_ID] => daniele


This is my configuration:
server {
                listen          8888;
                server_name proxy01.ced;

                keepalive_timeout 0;
                ssi off;

                underscores_in_headers on;

                location ~ / {
                        proxy_pass        http://test01.ced$request_uri;
                        proxy_set_header  X-Real-IP  $remote_addr;
                        proxy_set_header  Host $host;
                        proxy_set_header  X-Org-host $host;
                        proxy_set_header  X-Org-uri $request_uri;
                        proxy_set_header  X-Forwarded-For
$proxy_add_x_forwarded_for;
                        proxy_pass_header Server;
                        proxy_set_header X-UP-CALLING-LINE-ID
$HTTP_X_UP_CALLING_LINE_ID;
                }
}

I tried to play with:
- underscores_in_headers on|off
- proxy_set_header X-UP-CALLING-LINE-ID $HTTP_X_UP_CALLING_LINE_ID
- proxy_pass_header X-UP-CALLING-LINE-ID (also with underscore)

lines but without any fortune :)

Do you have any hits ?

Regards



More information about the nginx mailing list