Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

prox-pass removes SM_USER Header depending on the client

$
0
0
Dear nginx-Community,

Using the following configuration for a default docker nginx:1.11.3 container :

server {
listen 80;

server_name devrest.example.com;
root /devrestserver;
underscores_in_headers on;

location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_request_headers on;
proxy_pass http://devrest:8080;
}
}

I get a strange behaviour on some clients:
A provided SM_USER header disappears.

If I use curl on an ubuntu 16.04 to do a request, I find the following tcp dump listening on the docker network:

GET /resource/InstallationPlace HTTP/1.0
X-Forwarded-Host: devrest.example.com
X-Forwarded-Server: devrest.example.com
X-Forwarded-For: 178.12.225.55
Host: devrest:8080
Connection: close
User-Agent: curl/7.35.0
Accept: application/ld+json
Content-Type: application/ld+json
SM_USER: atnqtjrce0cjfve0fbjbsov2ff

and therefore get a correct answer from the API. The same when I use the RESTClient Add-On in Firefox (no matter which OS).

Am I using a java spring rest client, the SM_USER disappears - the same when using SoapUI in windows.

GET /resource/InstallationPlace/ HTTP/1.0
X-Forwarded-Host: devrest.example.com
X-Forwarded-Server: devrest.example.com
X-Forwarded-For: 178.12.225.55
Host: devrest:8080
Connection: close
Accept-Encoding: gzip,deflate
Encoding: UTF-8
Accept: application/ld+json
Content-Type: application/ld+json
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

It is there when I use tcp dump to listen before nginx changes the request:

GET /resource/InstallationPlace/ HTTP/1.1
Accept: text/plain, application/json, application/*+json, */*
Content-Type: application/json
SM_USER: atnqtjrce0cjfve0fbjbsov2ff
Accept-Language: de
User-Agent: Java/1.7.0_71
Host: devrest.example.com
Connection: keep-alive

As you can see I use
underscores_in_headers on;
and explicitly set
proxy_pass_request_headers on;
in the configuration.

Is there something else I can do to get the SM_USER header through? Maybe explicitly force this header to be set? If so, how can I do this?

Thank you in advance
Werner

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>