66server {
77 listen %ip%:%web_ssl_port% ssl http2;
88 server_name %domain_idn% %alias_idn%;
9- root %sdocroot %;
9+ root %docroot %;
1010 index index.php index.html index.htm;
1111 access_log /var/log/nginx/domains/%domain%.log combined;
1212 access_log /var/log/nginx/domains/%domain%.bytes bytes;
@@ -19,54 +19,57 @@ server {
1919
2020 include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
2121
22+ location = /favicon.ico {
23+ log_not_found off;
24+ access_log off;
25+ }
26+
27+ location = /robots.txt {
28+ allow all;
29+ log_not_found off;
30+ access_log off;
31+ }
32+
33+ location ~ /\.(?!well-known\/) {
34+ deny all;
35+ return 404;
36+ }
37+
38+ location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
39+ deny all;
40+ return 404;
41+ }
42+
2243 location / {
2344 try_files $uri $uri/ /index.php?$args;
24-
25- location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
26- expires max;
45+ 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)$ {
46+ expires 30d;
2747 fastcgi_hide_header "Set-Cookie";
2848 }
2949
30- # deny running scripts inside writable directories
31- location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
32- return 403;
33- error_page 403 /403_error.html;
34- }
35-
3650 location ~ [^/]\.php(/|$) {
3751 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
38- if (!-f $document_root$fastcgi_script_name) {
39- return 404;
40- }
41-
42- fastcgi_pass %backend_lsnr%;
43- fastcgi_index index.php;
44- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
52+ try_files $uri =404;
53+ fastcgi_pass %backend_lsnr%;
54+ fastcgi_index index.php;
4555 include /etc/nginx/fastcgi_params;
46- include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
56+ include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
57+ if ($request_uri ~* "/administrator/|index.php") {
58+ set $no_cache 1;
59+ }
4760 }
4861 }
4962
50- error_page 403 /error/404.html;
51- error_page 404 /error/404.html;
52- error_page 410 /error/410.html;
53- error_page 500 502 503 504 /error/50x.html;
54-
5563 location /error/ {
5664 alias %home%/%user%/web/%domain%/document_errors/;
5765 }
5866
59- location ~ /\.(?!well-known\/) {
60- deny all;
61- return 404;
62- }
63-
6467 location /vstats/ {
6568 alias %home%/%user%/web/%domain%/stats/;
6669 include %home%/%user%/web/%domain%/stats/auth.conf*;
6770 }
6871
69- include /etc/nginx/conf.d/phpmyadmin.inc*;
70- include /etc/nginx/conf.d/phppgadmin.inc*;
71- include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
72+ include /etc/nginx/conf.d/phpmyadmin.inc*;
73+ include /etc/nginx/conf.d/phppgadmin.inc*;
74+ include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
7275}
0 commit comments