A client (developed by a third party) is sending a request with headers like foo.meta-digest
(note the "dot" in the header name).
My nginx reverse proxy is removing these headers from the request even if I added ignore_invalid_headers off;
(see http://nginx.org/r/ignore_invalid_headers) to the server { ... }
block for this vhost:
upstream backend {
keepalive 128;
keepalive_requests 1000;
keepalive_timeout 120s;
server 127.0.0.1:32000 max_fails=0 fail_timeout=10;
}
server {
listen 443 ssl http2;
server_name foo.com;
root /var/www/empty;
ssl_certificate /etc/nginx/certs/foo.com.crt;
ssl_certificate_key /etc/nginx/certs/foo.com.key;
ignore_invalid_headers off;
location / {
proxy_pass http://backend;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Connection "";
}
}
I cannot reproduce this problem with any other client, except for this specific one and I don't have access to the source code of this client, it's proprietary software.
If I send the very same request using curl
or any other web client, all the headers, including the ones with a "dot" in the name, are passed to the backend as they should.
I tried even running a mitm attack against the nginx host and intercepted the network traffic from the client. The client is definitely sending the foo.meta-digest
header as expected.
Somehow nginx is filtering the header, but only for this specific client.
What else can I do to debug this problem?