title: Nginx proxy - return last-modified header from upstream
body: <p>I have problem with Nginx acting as proxy serwer: 
  request -> NGINX PROXY -> app server (only one)</p>
  
  <p>Proxy server is listening on port 443 and an application server on 80. Headers returned by upstream server are being removed by proxy. I was forced to use:</p>
  
  <p><code>add_header 'Content-Length' $upstream_http_content_length;</code></p>
  
  <p>It works ok for Content-Length, however it doesn't work with Last-Modified header. Curl request from Nginx proxy using private IP to upstream returns all the headers. Why does the Nginx proxy cut this header out even if it's return is specified using <code>add_header</code>?</p>
  
  <p>I have following nginx.conf sample:</p>
  
  <pre><code>location /some-web-app {
                      proxy_pass http://backend/some-web-app;
                      proxy_redirect off;
                      proxy_redirect http $scheme;
                      proxy_set_header Host $host;
                      add_header 'Last-Modified' $upstream_http_last_modified;
                      add_header 'Content-Length' $upstream_http_content_length;
                      sub_filter 'codebase="http' 'codebase="https';
                      sub_filter_types application/x-java-jnlp-file;
                      access_log /var/log/nginx/some-web-app_access.log combined_jsession_upstream;
                      error_log /var/log/nginx/some-web-app_err.log;
                      auth_basic            "Restricted";
                      auth_basic_user_file  /etc/nginx/htpasswd;
              }
  </code></pre>