Opened 6 months ago

Closed 6 months ago

#1762 closed defect (duplicate)

Duplicated headers not being passed to backend proxy

Reported by: gdhgdhgdh@… Owned by:
Priority: minor Milestone:
Component: other Version: 1.14.x
Keywords: Cc: gdh@…
uname -a: Linux ip-172-21-2-241.eu-west-2.compute.internal 3.10.0-957.10.1.el7.x86_64 #1 SMP Mon Mar 18 15:06:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.14.2 built by gcc 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC) built with OpenSSL 1.0.2k-fips 26 Jan 2017 TLS SNI support enabled configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie'

Description

Hi - given a location block like this :

     location /zz {
        proxy_set_header        Accept $http_accept;
        proxy_pass  http://localhost:9999${request_uri};
        proxy_http_version 1.1;
      }

I'm sending an HTTP request using curl:

curl -vH 'Accept: application/json' -H 'Accept: application/vnd.dummy-api.v2+json' http://localhost/zz

curl output shows me that two Accept headers are sent:

> GET /zz HTTP/1.1
> User-Agent: curl/7.29.0
> Host: localhost
> Accept: application/json
> Accept: application/vnd.dummy-api.v2+json

but the dummy HTTP server on port 9999 shows:

GET /zz HTTP/1.1
Accept: application/json
Host: localhost:9999
Connection: close
User-Agent: curl/7.29.0

I had really hoped Nginx would join the multiple Accept headers into a single comma-separated value as described in section 4.2 of https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html

Have I made a false assumption, is this a feature I can enable, or is it an Nginx bug?

Thanks!

Change History (1)

comment:1 Changed 6 months ago by mdounin

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #1316.

Note: See TracTickets for help on using tickets.