Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #more advanced configuration options and plugin info available here: https://rtcamp.com/wordpress-nginx/tutorials/single-site/fastcgi-cache-with-purging/
- fastcgi_cache_path /usr/share/nginx/cache/fcgi levels=1:2 keys_zone=microcache:10m max_size=1024m inactive=1h;
- set $no_cache 0;
- if ($request_method = POST){set $no_cache 1;}
- if ($query_string != \"\"){set $no_cache 1;}
- if ($http_cookie = \"PHPSESSID\"){set $no_cache 1;}
- if ($request_uri ~* \"/wp-admin/|/xmlrpc.php|wp-.*.php|/feed/|index.php|sitemap(_index)?.xml\") {set $no_cache 1;}
- if ($http_cookie ~* \"comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in\"){set $no_cache 1;}
- /etc/nginx/sites-available/default
- location / {/
- location ~ .php$ {
- try_files $uri =404;
- fastcgi_split_path_info ^(.+\\\.php)(/.+)$;
- fastcgi_cache microcache;
- fastcgi_cache_key $scheme$host$request_uri$request_method;
- fastcgi_cache_valid 200 301 302 30s;
- fastcgi_cache_use_stale updating error timeout invalid_header http_500;
- fastcgi_pass_header Set-Cookie;
- fastcgi_no_cache $no_cache;
- fastcgi_cache_bypass $no_cache;
- fastcgi_pass_header Cookie;
- fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
- fastcgi_pass unix:/var/run/php5-fpm.sock;
- fastcgi_index index.php;
- include fastcgi_params;
- }
- #benchmark from loadimpact: http://loadimpact.com/load-test/69.55.49.190-eabaf77a2ff22ab93bb978a8ecf485cb
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement