Issues with default_type
James G
james.g at lasgo.co.uk
Tue Apr 13 17:22:41 MSD 2010
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
More information about the nginx
mailing list