WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
Warning WPSuperCache 1.1 and nginx broken on multisite (16 posts)

  1. Niklas
    Member
    Posted 2 years ago #

    nginx (and other servers) does not populate $_SERVER[ 'SERVER_NAME' ] (used in 1.1) and therefore any WordPress installation with multisite and subdomains will fail to work properly.

    All *.domain.com till be redirected to domain.com.

    http://wordpress.org/extend/plugins/wp-super-cache/

  2. Tim Hyde
    Member
    Posted 2 years ago #

    Ah, yes same thing happened to may sites. Supercache no longer works for subdomains or mapped domains on multisite on nginx.

    Any fix for this? anybody?

  3. Tim Hyde
    Member
    Posted 2 years ago #

    I have reverted back to previous version for now. 1.1 does not work on nginx.

  4. borasque
    Member
    Posted 2 years ago #

    Same thing happened!
    It was very painfull update :(
    All my sites were screwed up by showing the same content.

  5. Manuel Schmalstieg
    Member
    Posted 2 years ago #

    Same issue here, on an average Apache server.

    Running WP 3.3.2 with WPSuperCache 1.1 and WordPress MU Domain Mapping (0.5.4.2) I encounter the same behavior : for a not-logged-in visitor, each domain shows the same site.

    It's not necessarily the #1 domain, but rather it's dependent on the cache. It's working fine when logged in as admin, with cache disabled.

    The not-logged-in visitor will always see the last domain that the admin has visited. As soon as I switch WPSuperCache off, the problem disappears.

    The issue only occurs for the base domain URL. When entering the URL of a specific page, the correct site is shown.

    For our luck, both plugins are developped by the same author, so I assume that a fix will follow soon :)

  6. tuofertaweb
    Member
    Posted 2 years ago #

  7. Niklas
    Member
    Posted 2 years ago #

    tuofertaweb

    That seems like an unrelated problem, your problem is about permissions in the cache directory, this thread deals with the problem that is caused due to version 1.1 using $_SERVER[ 'SERVER_NAME' ] to generate the cache folder structure. Some web servers (nginx among them) does not create the variable $_SERVER[ 'SERVER_NAME' ] and therefore the cache will be generated and sent for the wrong site.

  8. tuofertaweb
    Member
    Posted 2 years ago #

    niklasbr
    Thank you very much for the reply, but then there is a solution to my problem What I can do?

  9. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    Try the development version. I fixed the SERVER_NAME Problem.

    http://downloads.wordpress.org/plugin/wp-super-cache.zip

  10. Manuel Schmalstieg
    Member
    Posted 2 years ago #

    @ Donncha O Caoimh

    Tried it, works fine, fixes the issue for me. Thanx a lot!

  11. Manuel Schmalstieg
    Member
    Posted 1 year ago #

    If I install the plugin through the WordPress dashboard, as of today (September 4 2012) I still obtain the old version that causes the problem on multisite.

    Considering that this plugin gets around 15'000 downloads per week, why not update it?

  12. Tim Hyde
    Member
    Posted 1 year ago #

    Well it does takes time to release stuff. I'm just grateful Donncha continues to support the plugin as well as he does.

    You just need to download and then ftp it to your plugins folder.

  13. Manuel Schmalstieg
    Member
    Posted 1 year ago #

    Yep, but it seems that it's really tricky running Multisite and WP Super Cache together. Right now,

    I just went through the following procedure:
    1. Installed via FTP the newest multicache plugin, downloaded today (Sept. 4th 2012).
    2. Activated for all sites through the network admin - all works fine.
    3. Under the Super Cache settings > Plugins, I activated support for "Domain Mapping" - still all works fine.
    3. Changed some global Super Cache settings: "Use mod_rewrite to serve cache files", "Don’t cache pages for known users.", "Cache Timeout" - still all works fine.
    4. On one of the individual domains of the multi-site network, I go into the Super Cache settings and activate the CDN Support (with cloudfront). Immediately after that change, the problem appears for not-logged-in visitors - when they visit the front page of any domain of the network, they see the main network domain (#1). As previously, internal pages are not affected, only the root domain URL.
    5. I deactivate the CDN support for the affected domain. The issue remains.
    6. I disable Super Cache for the domain where I enabled CDN support - the issue remains.
    7. Just as a test, under the Network Admin > Super Cache Settings, I turn caching off and empty the cache for all blogs - the issue remains.
    8. As a final ressort, under Network Admin > Plugins I network-deactivate Super Cache. The issue remains - the footer of the pages still shows the "Cached page generated by WP-Super-Cache" tag.
    9. Finally, if I delete the plugin through the Network Admin, things go back to normal: each front page of each domain loads the correct domain.

    However, after that last step, another big problem appears: the internal navigation of all sites is broken, every page I visit appart from the root domain gives me a "404/Object not found!" page (generated by the server, not by WordPress).

    The issue is in the .htaccess - when I deleted the plugin, the URL rewrite rules inbetween # BEGIN WordPress and # END WordPress have been changed. More precisely, the first two lines have been stripped:

    RewriteEngine On
    RewriteBase /

    So to get the whole network working again, it's needed to fix the .htaccess manually.

    @ Tim Hyde - sure, I am grateful as well for Donncha's work. I think that the cache functionality and CDN support are wonderful. So I am very worried to see those issues with multisite, and would love to hear some update from Donncha.

  14. Dallas Lu
    Member
    Posted 1 year ago #

    @ Donncha O Caoimh
    So, when will this fixed released?

  15. Dallas Lu
    Member
    Posted 1 year ago #

    change nginx server config like this, it works:

    fastcgi_param SERVER_NAME $host;

  16. rahul286
    Member
    Posted 1 year ago #

    Its better to add fastcgi_param SERVER_NAME $http_host; line in nginx config like below:

    location ~ \.php$ {
                    fastcgi_param SERVER_NAME $http_host;
            }

    @Dallas Lu
    $host and $http_host may not have same value in some cases. For example, if domain has a port number like example.com:8080 then $host will strip-out 8080 which may create issues.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic