@@ -11,57 +11,61 @@ server {
1111 access_log /var/log/nginx/domains/% domain% .log combined;
1212 access_log /var/log/nginx/domains/% domain% .bytes bytes;
1313 error_log /var/log/nginx/domains/% domain% .error.log error;
14-
14+
1515 include % home% /% user% /conf/web/% domain% /nginx.forcessl.conf*;
1616
17+ location = /favicon.ico {
18+ log_not_found off;
19+ access_log off;
20+ }
21+
22+ location = /robots.txt {
23+ allow all;
24+ log_not_found off;
25+ access_log off;
26+ }
27+
28+ location ~ /\.(?!well-known\/) {
29+ deny all;
30+ return 404;
31+ }
32+
33+ location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
34+ deny all;
35+ return 404;
36+ }
37+
1738 location / {
1839 try_files $uri $uri / /index.php?$args ;
19-
20- location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
21- expires max;
40+ 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)$ {
41+ expires 30d;
2242 fastcgi_hide_header " Set-Cookie" ;
2343 }
2444
25- # deny running scripts inside writable directories
26- location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
27- return 403;
28- error_page 403 /403_error.html;
29- }
30-
3145 location ~ [^/]\.php(/|$) {
3246 fastcgi_param SCRIPT_FILENAME $document_root $fastcgi_script_name ;
33- if (! -f $document_root $fastcgi_script_name ) {
34- return 404;
35- }
36-
37- fastcgi_pass %backend_lsnr%;
38- fastcgi_index index.php;
39- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
47+ try_files $uri =404;
48+ fastcgi_pass % backend_lsnr% ;
49+ fastcgi_index index.php;
4050 include /etc/nginx/fastcgi_params;
41- include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
51+ include % home% /% user% /conf/web/% domain% /nginx.fastcgi_cache.conf*;
52+
53+ if ($request_uri ~* " /administrator/|index.php" ) {
54+ set $no_cache 1;
55+ }
4256 }
4357 }
4458
45- error_page 403 /error/404.html;
46- error_page 404 /error/404.html;
47- error_page 410 /error/410.html;
48- error_page 500 502 503 504 /error/50x.html;
49-
5059 location /error/ {
5160 alias % home% /% user% /web/% domain% /document_errors/;
5261 }
5362
54- location ~ /\.(?!well-known\/) {
55- deny all;
56- return 404;
57- }
58-
5963 location /vstats/ {
6064 alias % home% /% user% /web/% domain% /stats/;
6165 include % home% /% user% /web/% domain% /stats/auth.conf*;
6266 }
6367
64- include /etc/nginx/conf.d/phpmyadmin.inc*;
65- include /etc/nginx/conf.d/phppgadmin.inc*;
66- include %home%/%user%/conf/web/%domain%/nginx.conf_*;
68+ include /etc/nginx/conf.d/phpmyadmin.inc*;
69+ include /etc/nginx/conf.d/phppgadmin.inc*;
70+ include %home%/%user%/conf/web/%domain%/nginx.conf_*;
6771}
0 commit comments