• Hello,

    First thanks a lot for this plugin. A really nice idea.
    I configured plugin and nginx following tutorials (nginx + opcache + fast_cgi), all cache systeme work fine.
    Also, the “purge cache” backend button is perfectly working (is he also calling /purge/ url ?).

    But, the automatic purge system dont work. And if i try to access mysite.com/purge/, nginx send back the default 404 page..

    After some tests, i found that the mysite.com/purge/ is treated by the *.php* locaiton and not the ~ /purge/.

    I tried to put a if (in my php locaiton block) block starting the cache_purge using nginx module depending $request_uri, but i cant use the purge cache line in my PHP block in a if block.

    Really dont know what to do… Strange thing is that purge cache button is working (clear /var/run/nginx-cache well).

    Thanks in advance ! And really good work again.

    EDIT: just tried to access mysite.com/purge/mypage/, i have a “1” response on every url with /purge/ added. But, purge is not deleted. (/var/run/nginx-cache dont change, original url is ultra fast so no re-generation).
    https://wordpress.org/plugins/nginx-helper/

Viewing 4 replies - 1 through 4 (of 4 total)
  • PD

    (@peterdowney01)

    I seem to have encountered this problem as well. Were you ever able to resolve this issue?

    I had the same problem and took me a few hours to find what was going on.

    If you follow the docs for nginx helper, you go to
    http://yoursite.com/purge/permalink-slug-here/
    and it will show you 404 page…

    however, if you go to:
    http://yoursite.com/purge//permalink-slug-here/
    (not the double slash) it works.

    This is because your nginx configuration url is not properly escaped:

    On your nginx location, change:

    # allow purging
    location ~ /purge(/.*) {
    fastcgi_cache_purge WORDPRESS "$scheme$request_method$host$1";
    }

    to this:

    # allow purging
    location ~ /purge(\/.*) {
    fastcgi_cache_purge WORDPRESS "$scheme$request_method$host$1";
    }

    And now, http://yoursite.com/purge/permalink-slug-here/ should workd without the double slash.

    Note that if your permalink structure is something like %categry%/%postname%/ your purge url has to include the whole structure.

    Therefore if your url is:
    http://yoursite.com/mycategory/my-great-article-slug-here/

    You must purge it with:
    http://yoursite.com/purge/mycategory/my-great-article-slug-here/

    Thread Starter mtxz

    (@mtxz)

    Hey !

    Thanks for advices.
    I just tried, and still dont work for me..

    Both url /purge/slug and /purge//slug redirect me to /slug/ wordpress front-end page.
    Cache is generated for both URL (different cache folders appear), and redirection is ultra fast as url are cached.

    Cache is never purged until i press the button in the backend admin.

    Its crazy !

    EDIT: /purge/ page redirect me to wordpress 404 page.

    Reloaded or Restarted nginx?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Purge location (/purge/) return 404 – cant auto-purge’ is closed to new replies.