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

andrea.mandoloMay 24, 2013 04:58AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 107
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 184 on July 08, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready