|
|
@@ -30,29 +30,36 @@ server {
|
|
|
access_log off;
|
|
|
}
|
|
|
|
|
|
- location / {
|
|
|
- try_files $uri $uri/ /index.php?$args;
|
|
|
+ location ~ /\.(?!well-known\/) {
|
|
|
+ deny all;
|
|
|
+ return 404;
|
|
|
+ }
|
|
|
|
|
|
- if (!-e $request_filename)
|
|
|
- {
|
|
|
- rewrite ^(.+)$ /index.php?q=$1 last;
|
|
|
- }
|
|
|
+ location ~* /(?:uploads|files)/.*.php$ {
|
|
|
+ deny all;
|
|
|
+ return 404;
|
|
|
+ }
|
|
|
|
|
|
- location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
|
|
|
- expires max;
|
|
|
+ location / {
|
|
|
+ try_files $uri $uri/ /index.php?$args;
|
|
|
+ location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
|
|
|
+ expires 30d;
|
|
|
fastcgi_hide_header "Set-Cookie";
|
|
|
}
|
|
|
|
|
|
location ~ [^/]\.php(/|$) {
|
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
|
- if (!-f $document_root$fastcgi_script_name) {
|
|
|
- return 404;
|
|
|
- }
|
|
|
-
|
|
|
- fastcgi_pass %backend_lsnr%;
|
|
|
- fastcgi_index index.php;
|
|
|
+ try_files $uri =404;
|
|
|
+ fastcgi_pass %backend_lsnr%;
|
|
|
+ fastcgi_index index.php;
|
|
|
include /etc/nginx/fastcgi_params;
|
|
|
- include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
|
|
|
+ include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
|
|
|
+ if ($request_uri ~* "/wp-admin/|wp-.*.php|xmlrpc.php|index.php|/store.*|/cart.*|/my-account.*|/checkout.*") {
|
|
|
+ set $no_cache 1;
|
|
|
+ }
|
|
|
+ if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|woocommerce_items_in_cart|woocommerce_cart_hash|PHPSESSID") {
|
|
|
+ set $no_cache 1;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -60,19 +67,12 @@ server {
|
|
|
alias %home%/%user%/web/%domain%/document_errors/;
|
|
|
}
|
|
|
|
|
|
- location ~ /\.(?!well-known\/) {
|
|
|
- deny all;
|
|
|
- return 404;
|
|
|
- }
|
|
|
-
|
|
|
location /vstats/ {
|
|
|
alias %home%/%user%/web/%domain%/stats/;
|
|
|
include %home%/%user%/web/%domain%/stats/auth.conf*;
|
|
|
}
|
|
|
|
|
|
- include /etc/nginx/conf.d/phpmyadmin.inc*;
|
|
|
- include /etc/nginx/conf.d/phppgadmin.inc*;
|
|
|
- include /etc/nginx/conf.d/webmail.inc*;
|
|
|
-
|
|
|
- include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
|
|
|
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
|
|
|
+ include /etc/nginx/conf.d/phppgadmin.inc*;
|
|
|
+ include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
|
|
|
}
|