Welcome! Log In Create A New Profile

Advanced

Override proxy's incorrect Content-Type via mime settings

Jonathan Matthews
September 23, 2011 12:38PM
Hi all -

I have an upstream proxy that sends the wrong Content-Type header for
a load of images. Sometime it doesn't send any header at all.

I'm trying to get Nginx not only to remove the upstream's Content-Type
header ("proxy_hide_header"), but also to insert the correct header.
Unfortunately, I can't hard-code the value as there are a variety of
image formats being used. "proxy_hide_header" doesn't seem to do
anything other than block the incorrect value, and
"proxy_ignore_headers" won't accept "Content-Type".

How can I both remote upstream's incorrect header, and also add the
header than Nginx *would* have used if it were serving the content
from local disk?
In other words, how do I add the header with a value derived from the
MIME settings currently configured, via the requested file's
extension?

Version 0.7.67, but can upgrade if required.

Many thanks,
Jonathan
--
Jonathan Matthews
London, UK
http://www.jpluscplusm.com/contact.html

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Override proxy's incorrect Content-Type via mime settings

Jonathan Matthews September 23, 2011 12:38PM

Re: Override proxy's incorrect Content-Type via mime settings

Jonathan Matthews September 23, 2011 12:46PM

Re: Override proxy's incorrect Content-Type via mime settings

Jonathan Matthews September 27, 2011 06:24PM

Re: Override proxy's incorrect Content-Type via mime settings

neoascetic September 23, 2013 06:44PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 251
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready