Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fastcgi_cache_path /home/userchanged/cache levels=1:2 keys_zone=subdomain.domain.tld:100m inactive=60m;
- server {
- listen 80;
- listen [::]:80;
- server_name subdomain.domain.tld;
- return 301 https://$server_name$request_uri;
- }
- server {
- listen 443 ssl http2;
- listen [::]:443 ssl http2;
- include snippets/ssl-subdomain.domain.tld.conf;
- include snippets/ssl-params.conf;
- server_name subdomain.domain.tld;
- access_log /home/userchanged/subdomain.domain.tld/logs/access.log;
- error_log /home/userchanged/subdomain.domain.tld/logs/error.log;
- root /home/userchanged/subdomain.domain.tld/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;
- }
- 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 / {
- try_files $uri $uri/ /index.php?$args;
- }
- location ~ \.php$ {
- try_files $uri =404;
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- fastcgi_pass unix:/run/php/php7.1-fpm.sock;
- fastcgi_index index.php;
- include fastcgi_params;
- fastcgi_cache_bypass $skip_cache;
- fastcgi_no_cache $skip_cache;
- fastcgi_cache subdomain.domain.tld;
- fastcgi_cache_valid 60m;
- }
- location ~ /.well-known {
- allow all;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement