Nginx wordpress wp super cache rewrite issue

Hello guys, this is MAX.

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:
http://www.flickr.com/photos/eastmobiles/5014221980/

I add include wp-supercache.conf; in nginx.cof:
http://www.flickr.com/photos/eastmobiles/5013657151/

You can find location.conf here:
http://www.flickr.com/photos/eastmobiles/5014266620/

But when I test it, it says:
http://www.flickr.com/photos/eastmobiles/5013664595/

Well line 10 is: if ($http_cookie ~*
“comment_author_|wordpress|wp-postpass_” )

Can anyone help? Thanks very much!!

P.S. why can’t I post image here? Please copy and past the link to view
the images.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,132868,132868#msg-132868

Hello,

It seems you have a typos mistakes in your supercache config file.

All “set $supercache_uri”, you have write a double quotes, it’s two
single quotes.
And line 7, you have write “suercache” instead of “supercache”.

Le 22/09/2010 09:37, neomax a écrit :

Hello Ben and Flavio Torres,

Thank you very much, I have made the changes to my configurations file
and the test is successful. But when I go to wp super cache admin page
and get all the parameters set, it just does not generate any .html
files, it shows:

WP-Cache (0KB)

* 0 Cached Pages
* 0 Expired Pages

WP-Super-Cache (0KB)

* 0 Cached Pages
* 0 Expired Pages

I deactivate and reactive it without any lucky, I log out and delete all
offline files and cookies, then reload the pages of my blog, and view
the source code, but could not find any sign showing files generated by
wp super cache, nothing.

Can you help me? I am now testing this blog, so I point my domain to my
VPS IP in hosts file in c:\windows\system32\drivers\etc while the real
IP is not this one.

Thanks a lot in advance.

MAX

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,132868,132986#msg-132986

-----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-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/22/2010 12:47 PM, neomax wrote:

But when I go to wp super cache admin page and get all the
parameters set, it just does not generate any .html files, it
shows:

HUm… browse the source code of a random post and check if you will
be noticed with this line of code on the VERY last line:

If so, just fix it :slight_smile:

Also, using nginx, wordpress needs this plugin:
http://wordpress.org/extend/plugins/nginx-compatibility/

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

iEYEARECAAYFAkyaK+0ACgkQNRQApncg295IfwCg7EJPRLbudoZU7HNaIdXAFWN2
xbQAoMz1bXLoAdhi/0R8gES9AlO2/rC2
=DOW5
-----END PGP SIGNATURE-----

neomax Wrote:

0/http://www.flickr.com/photos/eastmobiles/5014221
620/

P.S. why can’t I post image here? Please copy and
past the link to view the images.

Just to add my take on the wp-supercache config:

http://test.brianmercer.com/content/nginx-configuration-wordpress-wp-super-cache

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,132868,133075#msg-133075

On 22.09.2010 09:37, neomax wrote:

http://www.flickr.com/photos/eastmobiles/5013657151/
Can anyone help? Thanks very much!!

P.S. why can’t I post image here? Please copy and past the link to view
the images.

I am not a wordpress guy but I have working (I think) wp-super-cache
with nginx, propably in legacy mode but it’s working as I can see in the
end of html code:

All what I did is just…

     try_files $uri $uri/ /index.php?q=$uri&$args;

Thats all. WP-super-cache warning me about missing mod_rewrite but I
don’t really care, its not apache.

– Piotr.

Hi Ben and Piotr,

Thank you guys, many thanks.

I installed the Nginx compatibility plungin, and it still does not work,
but wp super cache do not say anything like mode rewrite has not been
installed anymore, but I still can not see any static files being
generated.

Piotr, I tried your code and yes, the pretty url works, but when I view
the source code when log out, I could not see anything like:

As a matter of fact, I could noe even find the letter cache.

I doubt if anything wrong with my web server or wp super cache. When I
click on test cache, it says:

Fetching http://cellphonetrackers.org/ to prime cache: OK

Fetching first copy of http://cellphonetrackers.org/: OK

Fetching second copy of http://cellphonetrackers.org/: OK

Page 1: 2010-09-12 06:25:16

Page 2: 2010-09-12 06:25:16

The data show above is before I moved my blog to my VPS, every time I
test it, it shows the same date. So I uninstalled wp super cache twice
and delete its files and folder completely, then reinstall it, still no
luck.

I checked the /wp-content/cache folder, only to find a folder called
meta, but no static files.

Is there anything to do with Nginx settings or wp super cache? wp super
cache used to work well with apach without any effort.

Thanks a lot, since I have no expierince with Nginx, I am completely at
a loss about what to do.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,132868,133246#msg-133246

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs