daily pastebin goal
57%
SHARE
TWEET

Untitled

a guest Aug 5th, 2015 169 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fastcgi_cache_path /home/user/website.com/cache levels=1:2 keys_zone=WORDPRESS:100m inactive=60m;
  2. fastcgi_cache_key "$scheme$request_method$host$request_uri";
  3.  
  4. server {
  5.         server_name 1.1.1.1;
  6.         access_log /home/user/website.com/logs/access.log;
  7.         error_log /home/user/website.com/logs/error.log;
  8.         root /home/user/website.com/public/;
  9.         index index.php;
  10.  
  11.         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$
  12.  
  13.         location / {
  14.                 try_files $uri $uri/ /index.php?$args;
  15.         }
  16.  
  17.  
  18.         location ~ \.php$ {
  19.                 try_files $uri =404;
  20.                 fastcgi_split_path_info ^(.+\.php)(/.+)$;
  21.                 fastcgi_pass unix:/var/run/php5-fpm.sock;
  22.                 fastcgi_index index.php;
  23.                 fastcgi_cache_bypass $skip_cache;
  24.                 fastcgi_no_cache $skip_cache;
  25.                 fastcgi_cache WORDPRESS;
  26.                 fastcgi_cache_valid 60m;
  27.                 include fastcgi_params;
  28.         }
  29.  
  30.         location ~ /purge(/.*) {
  31.                 fastcgi_cache_purge WORDPRESS "$scheme$request_method$host$1";
  32.         }
  33.  
  34.         location ~*  \.(jpg|jpeg|png|gif|ico|css|js)$ {
  35.                 expires 365d;
  36.         }
  37.  
  38.         location ~*  \.(pdf)$ {
  39.                 expires 30d;
  40.         }
  41.  
  42. }
RAW Paste Data
Top