Welcome! Log In Create A New Profile

Advanced

Re: X-Accel-Redirect and Content-Type

Maxim Dounin
November 04, 2010 07:24PM
Hello!

On Thu, Nov 04, 2010 at 04:37:50PM -0400, soulodd wrote:

> Currently the application that is passing the X-Accel-Redirect uri back
> to nginx must set the Content-type header otherwise it will
> automatically be set to the default_type setting.

This is not true.

If not explicitly set by script together with X-Accel-Redirect -
Content-Type will be set by nginx according to extension of
redirect destination (and types/default_type defined, see [1]).

[1] http://wiki.nginx.org/HttpCoreModule#types

> Is there a way to get
> nginx to automatically detect the mime settings and transmit it?

See above for extension-based detection - this is how it works by
default. Just not returning Content-Type with X-Accel-Redirect is
enough.

If you are talking about content sniffing - no, it's not available
(at all).

> I've
> tried: fastcgi_ignore_headers Content-Type, but that gave me the error
> (taken from
> http://serverfault.com/questions/195060/nginx-x-accel-redirect-and-mime-types):
>
> [warn] 3988#1288: invalid value "Content-Type"

Directive fastcgi_ignore_headers never accepted "Content-Type"
value.

Maxim Dounin

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

X-Accel-Redirect and Content-Type

soulodd November 04, 2010 04:37PM

Re: X-Accel-Redirect and Content-Type

Maxim Dounin November 04, 2010 07:24PM

Re: X-Accel-Redirect and Content-Type

soulodd November 05, 2010 11:31AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 278
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