Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fastcgi_cache_path /home/user/website.com/cache levels=1:2 keys_zone=WORDPRESS:100m inactive=60m;
- fastcgi_cache_key "$scheme$request_method$host$request_uri";
- server {
- server_name 1.1.1.1;
- access_log /home/user/website.com/logs/access.log;
- error_log /home/user/website.com/logs/error.log;
- root /home/user/website.com/public/;
- index index.php;
- 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$
- location / {
- try_files $uri $uri/ /index.php?$args;
- }
- location ~ \.php$ {
- try_files $uri =404;
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- fastcgi_pass unix:/var/run/php5-fpm.sock;
- fastcgi_index index.php;
- fastcgi_cache_bypass $skip_cache;
- fastcgi_no_cache $skip_cache;
- fastcgi_cache WORDPRESS;
- fastcgi_cache_valid 60m;
- include fastcgi_params;
- }
- location ~ /purge(/.*) {
- fastcgi_cache_purge WORDPRESS "$scheme$request_method$host$1";
- }
- location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
- expires 365d;
- }
- location ~* \.(pdf)$ {
- expires 30d;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement