Welcome! Log In Create A New Profile

Advanced

Proxied request header names in SPDY are always lowercase

November 01, 2014 10:06AM
Hello!

I have a question about the behavior of proxing SPDY to HTTP with nginx.

First, there is a configuration like the following.

upstream app {
server 127.0.0.1:80;
keepalive 32;
}

server {
listen 443 ssl spdy;
server_name example.com;

proxy_set_header Connection "";
proxy_http_version 1.1;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

location / {
proxy_pass http://app;
}
}

Next, send a request to example.com with spdycat.

# spdycat is a command like curl for SPDY.
# https://github.com/tatsuhiro-t/spdylay
spdycat \
--spdy3-1 \
-H "User-Agent: spdycat" \
-H "X-VERSION: 1.3.1" \
"https://example.com/"

In this case, a proxied request to app is the following according to `# ngrep -W byline port 80 -d lo`

GET / HTTP/1.1
Host: example.com
X-Real-IP: xxx.xxx.xxx.xxx
X-Forwarded-Host: example.com
X-Forwarded-For: xxx.xxx.xxx.xxx
X-Forwarded-Proto: https
accept: */*
accept-encoding: gzip, deflate
user-agent: spdycat
x-version: 1.3.1


Even if request-header names are uppercase, proxied them become lowercase.

According to SPDY Protocol - Draft 3.1(http://www.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3-1),

* All header names must be lowercase.

Is this specific to a proxied request-header names to HTTP?
Or is there a solution except for the following workaround?

proxy_set_header User-Agent $http_user_agent;
proxy_set_header X-Version $http_x_version;

Thanks in advance!
Subject Author Posted

Proxied request header names in SPDY are always lowercase

cubicdaiya November 01, 2014 10:06AM

Re: Proxied request header names in SPDY are always lowercase

Valentin V. Bartenev November 01, 2014 10:26AM

Re: Proxied request header names in SPDY are always lowercase

cubicdaiya November 01, 2014 11:27AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 211
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready