Welcome! Log In Create A New Profile

Advanced

Override Content-Type header with proxied requests

May 23, 2013 11:07AM
Hi !!

i have a Nginx server that operates as a reverse proxy to a my bucket in Amazon S3.

Amazon S3 service could deliver contents with wrong Content-Type header,
so i would like to override this header by referring to file extension.

In other servers i have just configured the "types" block with all mime types mapped with file estensions,
but this approach only works when Nginx delivers contents directly (as a origin server).
If the server is a reverse proxy, doesn't add a new Content-Type header, but honors Content-Type (if exists) received by the origin.

Is it possible to override the content-type response header using "types" block? Is there any best practice to override content-type header by file extensions? Is "map" suggested for this purpose or using multiple "location" block is better?

Thanks in advance!!
---
Andrea
SubjectAuthorPosted

Override Content-Type header with proxied requests

andrea.mandoloMay 23, 2013 11:07AM

Re: Override Content-Type header with proxied requests

Jonathan MatthewsMay 23, 2013 11:12AM

Re: Override Content-Type header with proxied requests

António P. P. AlmeidaMay 23, 2013 11:26AM

Re: Override Content-Type header with proxied requests

António P. P. AlmeidaMay 23, 2013 11:34AM

Re: Override Content-Type header with proxied requests

manish-ezestAugust 06, 2014 08:18AM

Re: Override Content-Type header with proxied requests

andrea.mandoloMay 24, 2013 04:58AM

Re: Override Content-Type header with proxied requests

wandenbergAugust 07, 2014 12:12AM

Re: Override Content-Type header with proxied requests

manish-ezestAugust 07, 2014 11:57AM

Re: Override Content-Type header with proxied requests

wandenbergAugust 07, 2014 01:58PM

Re: Override Content-Type header with proxied requests

manish-ezestAugust 07, 2014 02:17PM

Re: Override Content-Type header with proxied requests

manish-ezestAugust 07, 2014 02:30PM

Re: Override Content-Type header with proxied requests

manish-ezestAugust 08, 2014 09:23AM

Re: Override Content-Type header with proxied requests

wandenbergAugust 08, 2014 11:44AM

Re: Override Content-Type header with proxied requests

manish-ezestAugust 08, 2014 10:34PM

Re: Override Content-Type header with proxied requests

manish-ezestAugust 13, 2014 06:18AM

Re: Override Content-Type header with proxied requests

flygoastAugust 09, 2014 11:36PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 53
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 229 on August 01, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready