Hi Group!
I try to use nginx configuration described in this post.
http://rtcamp.com/wordpress-nginx/tutorials/single-site/fastcgi-cache-with-purging/
This is my nginx config
user www www;
worker_processes 8;
events {
worker_connections 2048;
use kqueue;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
fastcgi_cache_path /var/tmp/nginx/nginx-cache levels=1:2 keys_zone=WORDPRESS:500m inactive=60m;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
fastcgi_cache_use_stale error timeout invalid_header http_500;
server {
listen 188.40.73.XXX:80;
server_name .site.com;
access_log /var/log/newexp-access.log;
error_log /var/log/newexp-error.log debug;
root /usr/local/www/data/www.site.com;
index index.php;
if ($host = 'site.com') {
rewrite ^(.*)$ http://www.site.com$1 permanent;
}
rewrite ^(/forums/)(.*)$ http://forum.site.com/$2 permanent;
rewrite ^/plugins/p47_rsssyn/(.*)$ /?feed=rss permanent;
rewrite ^/plugins/p2_news/(.*)$ /news permanent;
set $skip_cache 0;
# POST requests and urls with a query string should always go to PHP
if ($request_method = POST) {
set $skip_cache 1;
}
if ($query_string != "") {
set $skip_cache 1;
}
# Don't cache uris containing the following segments
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitema
set $skip_cache 1;
}
# Don't use the cache for logged in users or recent commenters
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {
set $skip_cache 1;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ .php$ {
try_files $uri /index.php;
include fastcgi_params;
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_cache_bypass $skip_cache;
fastcgi_no_cache $skip_cache;
fastcgi_cache WORDPRESS;
fastcgi_cache_valid 60m;
}
location ~ /purge(/.*) {
fastcgi_cache_purge WORDPRESS "$scheme$request_method$host$1";
}
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
access_log off; log_not_found off; expires max;
}
location = /robots.txt { access_log off; log_not_found off; }
location ~ /\. { deny all; access_log off; log_not_found off; }
}
}
but when i apply this config i see only blank screen and errors like this in my log
root@mx1/usr/local/etc/nginx> nginx -t nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
root@mx1/usr/local/etc/nginx> ls -lhad /var/tmp/nginx/nginx-cache/ drwx------ 18 www www 512B 12 июн 15:32 /var/tmp/nginx/nginx-cache/ root@mx1/usr/local/etc/nginx>
PID PPID USER %CPU VSZ WCHAN COMMAND 63225 89212 www 0,0 537048 kqread nginx: worker process (nginx) 63226 89212 www 0,0 537048 kqread nginx: worker process (nginx) 63227 89212 www 0,0 537048 kqread nginx: worker process (nginx) 63228 89212 www 0,0 537048 kqread nginx: worker process (nginx) 63229 89212 www 0,0 537048 kqread nginx: worker process (nginx) 63230 89212 www 0,0 537048 kqread nginx: worker process (nginx) 63231 89212 www 0,0 537048 kqread nginx: worker process (nginx) 63232 89212 www 0,0 537048 kqread nginx: worker process (nginx) 63233 89212 www 0,0 537048 kqread nginx: cache manager process (nginx) 63234 89212 www 0,0 537048 kqread nginx: cache loader process (nginx) 89212 1 root 0,0 537048 pause nginx: master process /usr/local/sbin/nginx 63611 42537 root 0,0 2484 vnread egrep (nginx|PID) root@mx1/usr/local/etc/nginx>
root@mx1/usr/local/etc/nginx> du -h /var/tmp/nginx/nginx-cache/ 4,0k /var/tmp/nginx/nginx-cache/4/fd 4,0k /var/tmp/nginx/nginx-cache/4/f5 4,0k /var/tmp/nginx/nginx-cache/4/c0 4,0k /var/tmp/nginx/nginx-cache/4/47 4,0k /var/tmp/nginx/nginx-cache/4/53 4,0k /var/tmp/nginx/nginx-cache/4/09 26k /var/tmp/nginx/nginx-cache/4 4,0k /var/tmp/nginx/nginx-cache/9/de 4,0k /var/tmp/nginx/nginx-cache/9/7c 4, . . 4,0k /var/tmp/nginx/nginx-cache/a/0d 22k /var/tmp/nginx/nginx-cache/a 558k /var/tmp/nginx/nginx-cache/ root@mx1/usr/local/etc/nginx>
but in browser i see only blank screen :(