Welcome! Log In Create A New Profile

Advanced

Re: Nginx Cache and WP canonical URL create infinite loop (bug ?)

Maxim Dounin
November 23, 2011 12:42PM
Hello!

On Wed, Nov 23, 2011 at 06:11:41PM +0100, Simone Fumagalli wrote:

> > Could you please show your config?
>
> Nothing special, here we go (only important parts)
>
> server {
>
> server_name www.mysite.com
> listen 1.2.3.4:80
>
> proxy_redirect off;
> proxy_set_header Host $host;
> proxy_set_header X-Real-IP $remote_addr;
> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
> proxy_store_access user:rw group:rw all:r;
>
> location / {
>
> # If logged in, don't cache.
> if ($http_cookie ~* "comment_author_|wordpress_(?!test_cookie)|wp-postpass_" ) {
> set $do_not_cache 1;
> }
>
> # Response in not cached
> proxy_no_cache $do_not_cache;
>
> # Response is not taken from the cache
> proxy_cache_bypass $do_not_cache;
>
> proxy_cache MY_CACHE;
> proxy_pass http://ALL_backend;
>
> }
>
> location ~ /purge(/.*) {
> proxy_cache_purge MY_CACHE "$scheme://$host$1$is_args$args";
> }
>
> }
>
> > By default nginx will use the same uri in cache as it will use in request to upstream, and this shouldn't happen
>
> AFAIK when I require http://www.mysite.com/my-page// the key for the cache is set to http://www.mysite.com/my-page/

With this config, the cache key for the request to
"http://www.mysite.com/my-page//" will be
"http://ALL_backend/my-page//".

Maxim Dounin

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

Nginx Cache and WP canonical URL create infinite loop (bug ?)

Simone Fumagalli November 23, 2011 11:28AM

Re: Nginx Cache and WP canonical URL create infinite loop (bug ?)

Maxim Dounin November 23, 2011 12:06PM

Re: Nginx Cache and WP canonical URL create infinite loop (bug ?)

Simone Fumagalli November 23, 2011 12:12PM

Re: Nginx Cache and WP canonical URL create infinite loop (bug ?)

Maxim Dounin November 23, 2011 12:42PM

Re: Nginx Cache and WP canonical URL create infinite loop (bug ?)

Simone Fumagalli November 24, 2011 03:52AM

Re: Nginx Cache and WP canonical URL create infinite loop (bug ?)

Maxim Dounin November 24, 2011 05:18AM

Re: Nginx Cache and WP canonical URL create infinite loop (bug ?)

Simone Fumagalli November 24, 2011 08:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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