Nginx – Preserve response headers in NGINX load balancer

ibm-dominoload balancingnginxreverse-proxy

I have set up NGINX as a load balancer for two Domino servers this way:

http {

    upstream www.mydomain.com {
      server 1.1.1.1;
      server 2.2.2.2 backup;
    }

    server {
        listen       80;
        server_name  www.mydomain.com;

        location / {
            proxy_pass http://www.mydomain.com;
        }
    }
}

If I access the Domino server directly the response headers are these:

HTTP/1.1 200 OK
Server: Lotus-Domino
Date: Mon, 23 Dec 2013 12:19:36 GMT
Last-Modified: Fri, 20 Dec 2013 08:16:27 GMT
Content-Type: text/html; charset=US-ASCII
Content-Length: 12713
Cache-control: private
ETag: W/"MTAtODEwRC1DMjI1N0MzRDAwN0M3NTBCLUMyMjU3QzQ3MDAyRDczMzktMC1DTj1QYW51IEhhYXJhbW8vTz1BQUQ="

When I access the same page via NGINX the response headers are these:

HTTP/1.1 200 OK
Server: nginx/1.0.15
Date: Mon, 23 Dec 2013 12:02:29 GMT
Content-Type: text/html; charset=US-ASCII
Connection: keep-alive
Last-Modified: Mon, 23 Dec 2013 12:20:47 GMT
Expires: Tue, 01 Jan 1980 06:00:00 GMT
Content-Length: 12713

Can I configure NGINX to pass the response headers exactly as I get them directly from Domino? I know I can set some of these one by one like this:

proxy_pass_header Server;

But for example ETag will not be passed even this way.

Best Answer

Most probably nginx modifies a response from upstream due to enabled gzip, for instance. You could find more information here.

Related Topic