Welcome! Log In Create A New Profile

Advanced

Issues with default_type

James G
April 13, 2010 09:30AM
Here's a snippet of my configuration:
location /resource/image/
{
default_type image/jpeg;
add_header Content-Type image/jpeg;
mogilefs_tracker 192.168.0.1:7001;
mogilefs_domain 'repository:images';

mogilefs_pass
{
proxy_pass $mogilefs_path;
proxy_hide_header Content-Type;
proxy_buffering off;
}
}

So I've set the default type, forced the header with add_header, and
told the proxy_pass not to send the Content-Type header. So we should
be getting the Content-Type of "image/jpeg", right?
$ curl -i http://192.168.0.5/resource/image/af795ed0357e19afcc4a63bbcee1fd10
HTTP/1.1 200 OK
Server: nginx/0.7.65
Date: Tue, 13 Apr 2010 11:09:32 GMT
Content-Type: text/plain
Connection: keep-alive
Content-Length: 25871
Last-Modified: Tue, 09 Feb 2010 14:56:31 GMT
Accept-Ranges: bytes

????JFIFdd?....

Maybe not. Is this because curl is sending silly accept headers? Well,
let's ask Wireshark:
GET /resource/image/af795ed0357e19afcc4a63bbcee1fd10 HTTP/1.1
User-Agent: curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3
OpenSSL/0.9.7l zlib/1.2.3
Host: 192.168.0.5
Accept: */*

Nope. In addtion to this Firefox shows the exact same headers being
returned by the server. This does appear to be some sort of bug within
either nginx, or the mogilefs module. At no other point in the
configuration is add_header, or default_type being set. Even with a
default_type being set (of application/octet-stream) inside the top
level of server{} block, the results remain the same.

Is this a bug, and if not, what have I done wrong?

Regards

~ James


Lasgo Chrysalis Limited. Registered in England & Wales No. 1380166.
Part of the Chrysalis Plc.
Registered office: The Chrysalis Building, Bramley Road, London W10 6SP


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

Issues with default_type

James G April 13, 2010 09:30AM

Re: Issues with default_type

Maxim Dounin April 13, 2010 12:34PM

Re: Issues with default_type

James G April 13, 2010 01:46PM

Re: Issues with default_type

Alejandro Mery April 13, 2010 04:00PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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