Nginx 1.17.0 doesn't change the content-type header

Francis Daly francis at daoine.org
Wed Jul 3 12:22:21 UTC 2019


On Wed, Jul 03, 2019 at 06:17:46AM +0000, Andrew Andonopoulos wrote:

Hi there,

I think that the point is:

nginx does not change the content-type header from the upstream server.

If you want your nginx to do that, you have to configure your nginx to
do that -- probably using "add_header".

> Nginx deliver the file from the cache but the content-type is from
> the default in the HTTP rather than the location in the Server

The "types" configuration applies when nginx serves a file from the
filesystem.

If you proxy_pass, nginx does not serve a file from the filesystem.

The "correct" fix is for you to ensure that your upstream server sends
the content-type header that you want.

The alternate fix is for you to configure your nginx server to send the
content-type header that you want; you will need to tell nginx how to
know what that header value is, for each response that you make.

Good luck with it,

	f
-- 
Francis Daly        francis at daoine.org


More information about the nginx mailing list