From 1fb49defede2df06dcd82a81fc4beafe973577aa Mon Sep 17 00:00:00 2001 From: Bram Prieshof Date: Wed, 11 Mar 2020 11:50:40 +0100 Subject: [PATCH] Add 'CMS/wordpress/Nginx-unconfigured' --- CMS/wordpress/Nginx-unconfigured | 67 ++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 CMS/wordpress/Nginx-unconfigured diff --git a/CMS/wordpress/Nginx-unconfigured b/CMS/wordpress/Nginx-unconfigured new file mode 100644 index 0000000..988dd0a --- /dev/null +++ b/CMS/wordpress/Nginx-unconfigured @@ -0,0 +1,67 @@ +#beginConf +root /var/www/DOMAINname/html; +gzip on; +gzip_proxied any; +gzip_types text/plain text/css text/xml text/javascript application/javascript application/x-javascript image/svg image/svg+xml application/xml image/x-icon; +gzip_comp_level 2; +gzip_disable "msie6"; +gzip_buffers 16 8k; + + +location / { + try_files $uri $uri/ /index.php$is_args$args; +} + +location = /favicon.ico { log_not_found off; access_log off; } +location = /robots.txt { log_not_found off; access_log off; allow all; } +location ~* \.(css|gif|ico|jpeg|jpg|js|png|svg|webp|eot|otf|woff|woff2|ttf|ogg)$ { + expires max; + log_not_found off; + add_header Cache-Control "public, no-transform"; +} + +location ~ \.php$ { + include snippets/fastcgi-php.conf; + fastcgi_pass unix:/var/run/php/phpPHPver-fpm.sock; +} + +location ~ /\.ht { + deny all; +} + +#Cache everything by default +set $no_cache 0; + +#Don't cache POST requests +if ($request_method = POST) { + set $no_cache 1; +} + +#Don't cache if the URL contains a query string +if ($query_string != "") { + set $no_cache 1; +} + +#Don't cache the following URLs +if ($request_uri ~* "/(administrator/|login.php)") { + set $no_cache 1; +} + +#Don't cache if there is a cookie called PHPSESSID +if ($http_cookie = "PHPSESSID") { + set $no_cache 1; +} +# Increase bodysize for WP Rocket +client_max_body_size 256M; +## Rocket-Nginx configuration +#include wprocket-nginx.conf; +#Yoast SEO Sitemaps +location ~ ([^/]*)sitemap(.*).x(m|s)l$ { + ## this rewrites sitemap.xml to /sitemap_index.xml + rewrite ^/sitemap.xml$ /sitemap_index.xml permanent; + ## this makes the XML sitemaps work + rewrite ^/([a-z]+)?-?sitemap.xsl$ /index.php?xsl= last; + rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last; + rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=&sitemap_n= last; +} +#endConf \ No newline at end of file