This is an interesting feature, would be awsome if this got included in the core. Can it be made to work based of DELETE (method) requests I wonder?<br><br><div class="gmail_quote">On Fri, Oct 7, 2011 at 1:11 AM, ahu <span dir="ltr"><<a href="mailto:nginx-forum@nginx.us">nginx-forum@nginx.us</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I need some help on "FASTCGI(PHP) CACHE PURGE".<br>
<br>
I successfully configured my nginx to support purge fastcgi cache with<br>
Ctrl+F5,while I found that I can not purge the cache by request a uri<br>
like below:<br>
<br>
<a href="http://myserver.com/purge/test.php" target="_blank">http://myserver.com/purge/test.php</a><br>
OR<br>
<a href="http://myserver.com/purge/myserver.com/test.php" target="_blank">http://myserver.com/purge/myserver.com/test.php</a><br>
<br>
It always returns a 404 error :(<br>
<br>
HOW CAN I DO IT? Please help me~<br>
<br>
Here is the key part of my nginx.conf:<br>
<br>
----------------------------------------------------------<br>
http {<br>
include mime.types;<br>
default_type application/octet-stream;<br>
<br>
...<br>
<br>
fastcgi_cache_path /tmp/fastcgi_cache levels=1:2 keys_zone=TEST:10m<br>
inactive=5m;<br>
fastcgi_connect_timeout 300;<br>
fastcgi_send_timeout 300;<br>
fastcgi_read_timeout 300;<br>
fastcgi_buffer_size 16k;<br>
fastcgi_buffers 16 16k;<br>
fastcgi_busy_buffers_size 16k;<br>
fastcgi_temp_file_write_size 16k;<br>
fastcgi_cache TEST;<br>
<div class="im"> fastcgi_cache_valid 200 302 1h;<br>
fastcgi_cache_valid 301 1d;<br>
fastcgi_cache_valid any 1m;<br>
fastcgi_cache_min_uses 1;<br>
fastcgi_cache_use_stale error timeout invalid_header http_500;<br>
</div> fastcgi_cache_key $host$uri$is_args$args;<br>
<br>
...<br>
<br>
server {<br>
listen 80;<br>
server_name <a href="http://myserver.com" target="_blank">myserver.com</a>;<br>
root /home/wwwroot;<br>
index index.html index.htm index.php;<br>
<br>
if ($request_method = 'PURGE') {<br>
rewrite ^(.*)$ /purge$1 last;<br>
}<br>
<br>
if ($http_cache_control ~ "no-cache") {<br>
set $http_cache_control 'max-age=604800';<br>
rewrite ^(.*)$ /purge$1 last;<br>
}<br>
<br>
location ~ /purge(/.*) {<br>
#allow 127.0.0.1;<br>
#deny all;<br>
fastcgi_cache_purge TEST $host$1$is_args$args;<br>
}<br>
<br>
location ~ .*\.(php|php5)?$ {<br>
fastcgi_pass unix:/tmp/php-cgi.sock;<br>
fastcgi_index index.php;<br>
fastcgi_split_path_info ^(.+\.php)(.*)$;<br>
include fcgi.conf;<br>
}<br>
<br>
...<br>
<br>
log_format access '$remote_addr - $remote_user [$time_local]<br>
"$request" '<br>
'$status $body_bytes_sent "$http_referer" '<br>
'"$http_user_agent"<br>
$http_x_forwarded_for';<br>
access_log /home/wwwlogs/access.log access;<br>
}<br>
<br>
}<br>
----------------------------------------------------------<br>
<br>
Posted at Nginx Forum: <a href="http://forum.nginx.org/read.php?2,39564,216317#msg-216317" target="_blank">http://forum.nginx.org/read.php?2,39564,216317#msg-216317</a><br>
<div class="im"><br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
</div><a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div><br>