I have an origin with all kind of files (css/js/jpg/png...) but for protection reasons it returns incorrect Conent-Type for all files.

I want to proxy that origin and serve those files.

Is there any way to have Nginx replace the Content-Type header with a correct one when using proxy_pass?

  • 1
    Why can't you fix the broken origin server? – Michael Hampton Apr 27 '14 at 23:46
  • I don't control the origin. I want to use its content and the owner is cool with it but they cant fix the MIMEs only for my IP. – Jim Apr 27 '14 at 23:49

nginx's Headers More module should do the trick. http://wiki.nginx.org/HttpHeadersMoreModule tells more about the module.

You might need to compile your own version of nginx, since this is a third party module.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.