Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fastcgi_cache_path /var/run/proxy_cache levels=1:2 keys_zone=thecurlysue.com:100m max_size=10g inactive=300m;
- server {
- listen 80;
- listen [::]:80;
- access_log /var/log/nginx/proxy-access.log;
- error_log /var/log/nginx/proxy-error.log;
- add_header X-Cache $upstream_cache_status;
- root /var/www/thecurlysue.com;
- 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;
- }
- if ($query_string != "") {
- set $skip_cache 1;
- }
- # Don't cache uris containing the following segments
- if ($request_uri ~* "/wp-admin/|/xmlrpc.php|wp-.*.php|/feed/|index.php|sitemap(_index)?.xml") {
- 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 / {
- allow 192.88.134.0/23;
- allow 185.93.228.0/22;
- allow 2a02:fe80::/29;
- allow 66.248.200.0/22;
- deny all;
- try_files $uri $uri/ /index.php?$args;
- }
- location ~ \.php$ {
- allow 192.88.134.0/23;
- allow 185.93.228.0/22;
- allow 2a02:fe80::/29;
- allow 66.248.200.0/22;
- deny all;
- try_files $uri =404;
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- fastcgi_pass unix:/var/run/php/php5.6-fpm.sock;
- fastcgi_index index.php;
- include fastcgi_params;
- fastcgi_cache_bypass $skip_cache;
- fastcgi_no_cache $skip_cache;
- fastcgi_cache thecurlysue.com;
- fastcgi_cache_valid 300m;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement