Welcome! Log In Create A New Profile

Advanced

mediawiki fastcgi_cache not working

Anoop Alias
April 16, 2014 10:04AM
Hi,

I have setup nginx with ngx_cache_purge to work with mediawiki

nginx.conf
###
fastcgi_cache_path /etc/nginx/cache levels=1:2 keys_zone=MYAPP:100m
inactive=60m;
fastcgi_cache_key "$scheme$host$request_uri";
###

vhost.conf
###
set $no_cache "";
if ($request_method !~ ^(GET|HEAD)$) {
set $no_cache "1";
}




if ($request_method ~ "PURGE")
{
rewrite (.*) /PURGE$1 last;
}

location / {
if (!-e $request_filename) {
rewrite ^/([^?]*)(?:\?(.*))? /index.php?title=$1&$2
last;
}

if ($uri ~* "\.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$") {
expires max;
break;
}
}

location /PURGE/ {
allow 127.0.0.1;
fastcgi_cache_purge MYAPP;
}

location ~ \.php$ {

fastcgi_cache MYAPP;
fastcgi_cache_methods GET HEAD;
fastcgi_cache_valid 200 5m;
add_header X-Cache "$upstream_cache_status";
fastcgi_cache_bypass $no_cache $http_cookie;
fastcgi_no_cache $no_cache $http_cookie;
fastcgi_ignore_headers Expires Cache-Control;
}

####


The caching is working fine as .But whenever I edit a page I can see the
following in the access log

127.0.0.1 - - [16/Apr/2014:09:37:59 -0400] "PURGE /Knowledge_Base
HTTP/1.1" 405 166 "-" "MediaWiki/1.21.3 SquidPurgeClient" - "-" 0


Regardless the page is never purged and I see the cached page unless nginx
is restarted .

What am I doing wrong here . Why is the PURGE request generating a 405
response?

Thank you,

--
*Anoop P Alias*
GNUSYS http://gnusys.net
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

mediawiki fastcgi_cache not working

Anoop Alias April 16, 2014 10:04AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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