Quantcast
Channel: Nginx Forum - Nginx Mailing List - English
Viewing all articles
Browse latest Browse all 7229

Override Content-Type header with proxied requests (4 replies)

$
0
0
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

Viewing all articles
Browse latest Browse all 7229

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>