Facing content-type issue with try_files.

Nicholas Sherlock n.sherlock at gmail.com
Thu May 8 04:39:18 UTC 2014


On 6 May 2014 16:39, Makailol Charls <makailol7 at gmail.com> wrote:

> Is it necessary to have an extension to image file to set proper
> content-type for Nginx? Couldn't web server set the content-type from *file
> type* ?
>

That would require Nginx to inspect the file contents and make a guess as
to what file type it is. I don't know if it could do that.

You could try just using:

add_header Content-Type image/jpeg;

And hope that the user's web browser will automatically work out the
correct Content-Type, if the image was actually a PNG or something.

Cheers,
Nicholas Sherlock
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20140508/7b34c636/attachment.html>


More information about the nginx mailing list