<div dir="ltr"><div><div><div><div>Hello,<br><br></div>Could someone help me with my previous query?<br><br></div>Actually the problem is that when image file doesn't have an extension it is not being served with proper content type. Instead it is served with "application/octet-stream" content-type. Due to this browser try to download image instead of displaying it.<br>
<br></div>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* ?<br><br></div>Thanks,<br><div><div><br></div></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Fri, May 2, 2014 at 10:42 AM, Makailol Charls <span dir="ltr"><<a href="mailto:makailol7@gmail.com" target="_blank">makailol7@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div><div><div><div>Hello,<br><br></div>To serve static contents i.e. images I use try_files directive of Nginx. My configuration location block is as below.<br><br> location ~* \.(jpg|jpeg|png|gif)$ {<br>
try_files $request_uri @missingImg;<br> }<br><br>@missingImg is named location block with proxy_* directive.<br><br></div>The above configuration works fine if the image file name ends with jpg, gif, jpeg, png extension in disk. When image file name(stored in disk) includes query string like "example.jpg?a=123" then request to such image is being served with application/octet-stream content-type . Because of the wrong content type, image is not being displayed and browser prompt to download image.<br>
<br></div>Could someone suggest me what am I doing wrong here?<br><br></div>Thanks,<br></div>Makailol<br><div><div><div><br><br></div></div></div></div>
</blockquote></div><br></div>