nginx-0.6.32-3: proxy_pass and $content_type

Cedric Jeanneret cedric.jeanneret at camptocamp.com
Tue Sep 15 16:23:24 MSD 2009


Hello,

We stumbled into a nice problem: we'd like to filter what nginx returns when used as a proxy_pass. We want nginx to return content only if content_type is an image, else en error like 403:

server {
	location / {
		proxy_pass ....
		if ($content_type !~* "image/") à
			return 403
		}
	}
}

Unfortunately, it seems that $content_type is set to "-", according to logfile....

Any idea ?

Thanks in advance.

Best regards,

C.

-- 
Cédric Jeanneret                 |  System Administrator
021 619 10 32                    |  Camptocamp SA
cedric.jeanneret at camptocamp.com  |  PSE-A / EPFL
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://nginx.org/pipermail/nginx/attachments/20090915/971b9645/attachment.pgp>


More information about the nginx mailing list