Adrián,<br><br>This would fix the problem, but I don't know the directories that has a .htaccess file with allow/deny.<br><br>Example:<br><br>Scenario: nginx (cache/proxy) + back-end apache<br><br>root@srv1 [~]# ls -a /home/domain/public_html/restrictedimages/<br>
./ ../ .htaccess image.jpg<br>root@srv1 [~]# cat /home/domain/public_html/restrictedimages/.htaccess <br>allow from x.x.x.x<br>deny from all<br><br>In the first access (source IP: x.x.x.x) to <a href="http://domain.com/restrictedimages/image.jpg">http://domain.com/restrictedimages/image.jpg</a>, nginx proxy request to apache and cache response. The problem comes in other request from other IP address different from x.x.x.x. Nginx deliver the objects from cache, even if the ip address is not authorized, because nginx doesn't understand .htaccess.<br>
<br>I would like to bypass cache in this cases, maybe using proxy_cache_bypass, but I don't know how. Any idea?<br><br><br><div class="gmail_quote">On Fri, Feb 10, 2012 at 4:08 PM, Adrián Navarro <span dir="ltr"><<a href="mailto:adrian@navarro.at">adrian@navarro.at</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Then there is no way you can cache. Pass everything for these dirs (/downloads) and filter htaccess with x-forwarded-for (make sure its being sent by nginx).<br>
<br>
By pure logic, the only way there would be to set the IP whitelist in the nginx config and check it even for cached items hit.<br>
<br>
<br>
Sent from my BlackBerry<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Adrián Navarro / <a href="tel:%28%2B34%29%20608%20831%20094" value="+34608831094">(+34) 608 831 094</a><br>
</font></span><div class="HOEnZb"><div class="h5"><br>
-----Original Message-----<br>
From: Guilherme <<a href="mailto:guilherme.e@gmail.com">guilherme.e@gmail.com</a>><br>
Sender: nginx-bounces@nginx.orgDate: Fri, 10 Feb 2012 15:57:31<br>
To: <<a href="mailto:nginx@nginx.org">nginx@nginx.org</a>><br>
Reply-To: <a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
Subject: Re: .htaccess issues<br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</div></div></blockquote></div><br>