Welcome! Log In Create A New Profile

Advanced

Re: Nginx wordpress wp super cache rewrite issue

Flavio Torres
September 22, 2010 09:56AM
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/22/2010 04:37 AM, neomax wrote:
> I recently set up my Nginx 0.765 in CentOS 5.5 and all are working well,
> then I moved my blog there and enabled permlink and rewrite, I used to
> run WP super cache, but when I configure it, it says: mode rewrite not
> enabled. So I google it and create a file called wp-supercache.conf you
> can find it here:

Hi neomax,


that's my conf for supercache, it's working like a charm.



#
# Regras para SuperCache
#

# Se o arquivo existir, retorne-o
if (-f $request_filename) {
break;
}

set $supercache_file '';
set $supercache_uri $request_uri;

if ($request_method = POST) {
set $supercache_uri '';
}

# Uso de permalinks, passa o cache para qualquer string
if ($query_string) {
set $supercache_uri '';
}

if ($http_cookie ~*
"comment_author_|wordpress|wp-postpass_" ) {
set $supercache_uri '';
}

# se nao passamos o cache, especifica o supercache
if ($supercache_uri ~ ^(.+)$) {
set $supercache_file
/wp-content/cache/supercache/$http_host/$1index.html;
}

# apenas reescreve para o supercache se o arquivo existir
if (-f $document_root$supercache_file) {
rewrite ^(.*)$ $supercache_file break;
}

# todas as outras requisicoes vao para o wordpress
if (!-e $request_filename) {
rewrite . /index.php last;
rewrite ^/(.+)$ /index.php last;
}

# regra para blog sem supercache - usar apenas esta
caso nao tenha supercache
#if (!-e $request_filename) {
# rewrite ^/(.+)$ /index.php last;
#}


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyaCXgACgkQNRQApncg294OrgCdEwnSQCdcoVjtmqEahNLhO8qU
2fcAn01Y8dGSA2CCYv0DW9XXqsbIQJrB
=/A48
-----END PGP SIGNATURE-----



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

Nginx wordpress wp super cache rewrite issue

neomax September 22, 2010 03:37AM

Re: Nginx wordpress wp super cache rewrite issue

Ben September 22, 2010 04:52AM

Re: Nginx wordpress wp super cache rewrite issue

Flavio Torres September 22, 2010 09:56AM

Re: Nginx wordpress wp super cache rewrite issue

neomax September 22, 2010 11:47AM

Re: Nginx wordpress wp super cache rewrite issue

Flavio Torres September 22, 2010 12:24PM

Re: Nginx wordpress wp super cache rewrite issue

Piotr Karbowski September 22, 2010 02:24PM

Re: Nginx wordpress wp super cache rewrite issue

brianmercer September 22, 2010 03:22PM

Re: Nginx wordpress wp super cache rewrite issue

neomax September 23, 2010 02:39AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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