- 論壇徽章:
- 0
|
本帖最后由 realcriss 于 2010-03-12 15:55 編輯
是這樣
nginx + proxy_cache_purge 清除不成功。
描述:
我拿網(wǎng)易做實(shí)驗(yàn),我的網(wǎng)關(guān)來cache他的內(nèi)容:
1.網(wǎng)關(guān)上訪問 http://www.163.com/index.shtml
2.然后在未過期時(shí)間,立即清除curl -v http://www.163.com/purge/index.shtml -x 127.0.0.1:80
3.然后就是- curl -I -H "Host: www.163.com" http://127.0.0.1/purge/upload/images/logo.gif
- HTTP/1.1 404 Not Found
- Server: nginx/0.8.33
- Date: Fri, 12 Mar 2010 07:49:57 GMT
- Content-Type: text/html
- Content-Length: 167
- Connection: keep-alive
- curl -I http://127.0.0.1/purge/www.163.com/upload/images/logo.gif
- HTTP/1.1 404 Not Found
- Server: nginx/0.8.33
- Date: Fri, 12 Mar 2010 07:52:46 GMT
- Content-Type: text/html
- Content-Length: 167
- Connection: keep-alive
- location ~ /purge(/.*) {
- allow 127.0.0.1;
- deny all;
- proxy_cache_purge WWW $host$1$is_args$args;
- }
復(fù)制代碼 4.使用 http://127.0.0.1/purge/www.163.com/index.shtml,也是404
purge配置文件- location ~ /purge(/.*) {
- allow 127.0.0.1;
- deny all;
- proxy_cache_purge WWW $1$is_args$args;
- }
復(fù)制代碼- sbin/nginx -V
- nginx version: nginx/0.8.33
- built by gcc 3.4.6 20060404 (Red Hat 3.4.6-8)
- configure arguments: --add-module=./ngx_cache_purge-1.0
復(fù)制代碼 |
|