I have the exact situation described in the wiki for the proxy_hide_header command, where my upstream server sends my JS & CSS files with the wrong Content-Type header. The file is currently being sent with a text/html content-type from the upstream server, but I am experiencing some occasional issues with browsers not rendering the CSS and suspect it may possibly be due to not having the correct content-type header, since I have read that this can sometimes cause the problems I am seeing.
I have the following line in my config file for specifying which file types gzip should compress.
My problem seems to be that once the Content-Type header is hidden with proxy_hide_header, nginx does not seem to be attempting to determine the correct type itself. My CSS & JS files are simply passed on uncompressed, with no content-type header. Mime-types are configured correctly in my nginx config, but it doesn't seem to make a difference for these particular files. I have tried using proxy_set_header to specifically set the content-type header as text/css, but nginx seems to completely ignore this and continues sending the file through without changing the content-type header.
Is there something I am missing here? How can I get nginx to recognize that the .css & .js files it is pulling from the upstream server should still be compressed even though the Content-Type header is being hidden? I am running nginx version 0.8.0.