如何configurationnginx将本地主机的PURGE请求传递给Varnish后端?
目前,脚本导致这一行出现在nginx日志中:
127.0.0.1 - - [23/Apr/2012:20:12:31 -0500] "PURGE /blog HTTP/1.1" 405 173 "-" "-"
有没有办法将这个清除请求重写到清漆后端(127.0.0.1:8080)?
像这样的东西可以工作:
error_page 418 = @purgepass; location / { if ($request_method = PURGE ) { return 418; } } location @purgepass { proxy_pass http://localhost:8080; }
没有testing,但理论上应该工作。
基于http://blog.rogeriopvl.com/archives/nginx-and-the-http-options-method/