Welcome! Log In Create A New Profile

Advanced

Re: Re[2]: .htaccess issues

February 12, 2012 10:38AM
On Fri, Feb 10, 2012 at 6:08 PM, Max <nginxyz@mail.ru> wrote:

>
> 10 февраля 2012, 23:40 от Guilherme <guilherme.e@gmail.com>:
> > This would fix the problem, but I don't know the directories that has a
> > .htaccess file with allow/deny.
> >
> > Example:
> >
> > Scenario: nginx (cache/proxy) + back-end apache
> >
> > root@srv1 [~]# ls -a /home/domain/public_html/restrictedimages/
> > ./ ../ .htaccess image.jpg
> > root@srv1 [~]# cat /home/domain/public_html/restrictedimages/.htaccess
> > allow from x.x.x.x
> > deny from all
> >
> > In the first access (source IP: x.x.x.x) to
> > http://domain.com/restrictedimages/image.jpg, 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.
> >
> > I would like to bypass cache in this cases, maybe using
> proxy_cache_bypass,
> > but I don't know how. Any idea?
>
> You could use this:
>
> proxy_cache_key $scheme$remote_addr$host$$server_port$request_uri;
>
> This would make originating IP addresses ($remote_addr) part of
> the cache key, so different clients would get the correct responses
> from the cache just as if they were accessing the backend directly,
> there's no need to bypass the cache at all.
>
> Max
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>

Max, good idea, but in the other requests, that I want to cache responses,
the cache size will grow too fast, because the same object will be cached a
lot of times, cause the ip adress is in the cache key (one cache entry per
IP).
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

.htaccess issues

Guilherme February 10, 2012 12:10PM

Re: .htaccess issues

António P. P. Almeida February 10, 2012 12:34PM

Re: .htaccess issues

Guilherme February 10, 2012 12:58PM

Re: .htaccess issues

António P. P. Almeida February 10, 2012 01:10PM

Re: .htaccess issues

Adrián Navarro February 10, 2012 01:10PM

Re: .htaccess issues

Guilherme February 10, 2012 02:42PM

Re: .htaccess issues

António P. P. Almeida February 10, 2012 03:00PM

Re: .htaccess issues

geberhart February 12, 2012 10:34AM

Re: .htaccess issues

António P. P. Almeida February 13, 2012 12:58PM

Re[4]: .htaccess issues

Max February 14, 2012 02:50AM

Re: Re[4]: .htaccess issues

António P. P. Almeida February 14, 2012 09:34AM

Re: Re[4]: .htaccess issues

António P. P. Almeida February 14, 2012 09:54AM

Re: Re[4]: .htaccess issues

geberhart February 14, 2012 11:48AM

Re[4]: .htaccess issues

Max February 12, 2012 08:06PM

Re[4]: .htaccess issues

Max February 12, 2012 08:10PM

Re[2]: .htaccess issues

Max February 10, 2012 03:10PM

Re: Re[2]: .htaccess issues

geberhart February 12, 2012 10:38AM

Re: .htaccess issues

Francis Daly February 12, 2012 11:50AM

Re[2]: .htaccess issues

Max February 13, 2012 04:14PM

Re: Re[2]: .htaccess issues

António P. P. Almeida February 13, 2012 04:46PM

Re[6]: .htaccess issues

Max February 14, 2012 07:38PM

Re: .htaccess issues

Piotr Sikora February 14, 2012 09:06PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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