All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
nginx and wp supercache
Hello i am trying to configure nginx to work with WP Supercache. First of all i am using the latest stable version of WP Super Cache which is 0.9.9.9 and this is the .htaccess rules WP Super Cache gives me on its plugin page;
`# BEGIN WPSuperCache
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
AddDefaultCharset UTF-8
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{QUERY_STRING} !.*=.*
RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f
RewriteRule ^(.*) "/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz" [L]
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{QUERY_STRING} !.*=.*
RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f
RewriteRule ^(.*) "/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html" [L]
</IfModule>
# END WPSuperCache`
So according to that; i am now going to post 2 wp super cache configs. If you help me to decide which one i should use i will be very glad. Also you can help me to improve my codes for best use. First of all i am going to post my nginx.conf. Here it is;
`user www-data www-data;
worker_processes 4;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
# General Settings
gzip on;
sendfile on;
tcp_nopush on;
tcp_nodelay off;
server_tokens off;
include mime.types;
keepalive_timeout 65;
default_type application/octet-stream;
# If we set index here, we won't have to anywhere else
index index.php index.html index.htm;
upstream php {
server unix:/tmp/php5-fpm.sock;
}
fastcgi_intercept_errors off;
include sites-enabled/*;
}`
Here is my restrictions.conf;
location = /robots.txt { access_log off; log_not_found off; } location = /favicon.ico { access_log off; log_not_found off; } location ~ /\. { access_log off; log_not_found off; deny all; } location ~ ~$ { access_log off; log_not_found off; deny all; }
Comments
And now i am going to post my two different domain.com configuration setups. They also include supercache related configs. Here is number 1;
And here is my domain.com number 2 setup;
So what do you think? Are there any errors? Which one do you suggest me to use? Also is this correct;
try_files /wp-content/cache/supercache/${http_host}${uri}index.html $uri $uri/ /index.php?q=$uri&$args;
according to this;
RewriteRule ^(.*) "/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz" [L]
And one last question; as you see wp supercache creates htaccess rules like index.html.gz not index.html so according to this should i change
/wp-content/cache/supercache/${http_host}${uri}index.html
to
/wp-content/cache/supercache/${http_host}${uri}index.html.gz
Thank you in advance.
Notes:
1-I have static gzip module compiled in with nginx.
2-There are one index.html and one index.html.gz files in my created cache folders.
3-I set cgi.fix_pathinfo to 0 in the php.ini
interesting, my friend was looking for this