HEAD request breaks fastxgi_cache
graq
nginx-forum at nginx.us
Fri Feb 18 15:09:10 MSK 2011
kaspars Wrote:
-------------------------------------------------------
> Btw, what kind of cache invalidation are you
> using, if any? Is it only time based or do you use
> nginx no_cache and cache_bypass directives
> (http://wiki.nginx.org/HttpFcgiModule#fastcgi_no_c
> ache) as well?
It is a WordPress configuration, which relies on the
nginx-proxy-cache-purge plugin to purge pages on update.
[code]
/etc/nginx/my.conf# cat wordpress-fastcgi-cache.conf
# Segment to include in all WP installs.
# Configures php-fpm (socket) with fastcgi caching.
set $nocache "";
if ($http_cookie ~
(comment_author_.*|wordpress_logged_in.*|wp-postpass_.*)) {
set $nocache "Y";
}
fastcgi_pass unix:/usr/local/var/run/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param CONTENT-LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
include fastcgi_params;
fastcgi_cache_use_stale error timeout invalid_header http_500;
fastcgi_cache_key $request_method$host$request_uri;
fastcgi_cache WORDPRESS;
fastcgi_cache_valid 200 10m;
fastcgi_ignore_headers Expires Cache-Control;
fastcgi_cache_bypass $nocache;
fastcgi_no_cache $nocache;
[/code]
[code]
/etc/nginx/my.conf# nginx -V
nginx version: nginx/0.8.53
built by gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5)
TLS SNI support enabled
configure arguments: --conf-path=/etc/nginx/nginx.conf
--error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid
--lock-path=/var/lock/nginx.lock
--http-log-path=/var/log/nginx/access.log
--http-client-body-temp-path=/var/lib/nginx/body
--http-proxy-temp-path=/var/lib/nginx/proxy
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi --with-debug
--with-http_stub_status_module --with-http_flv_module
--with-http_ssl_module --with-http_dav_module
--with-http_gzip_static_module --with-http_realip_module --with-mail
--with-mail_ssl_module --with-ipv6
--add-module=/usr/src/nginx/cache_purge
[/code]
http://wordpress.org/extend/plugins/nginx-proxy-cache-purge/
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,176381,176439#msg-176439
More information about the nginx
mailing list