|
1 | 1 | server { |
2 | | - listen %ip%:%web_ssl_port%; |
| 2 | + listen %ip%:%web_ssl_port% ssl http2; |
3 | 3 | server_name %domain_idn% %alias_idn%; |
4 | | - root %sdocroot%; |
| 4 | + ssl_certificate %ssl_pem%; |
| 5 | + ssl_certificate_key %ssl_key%; |
| 6 | + root %docroot%; |
5 | 7 | index index.php index.html index.htm; |
6 | 8 | access_log /var/log/nginx/domains/%domain%.log combined; |
7 | 9 | access_log /var/log/nginx/domains/%domain%.bytes bytes; |
8 | 10 | error_log /var/log/nginx/domains/%domain%.error.log error; |
9 | 11 |
|
10 | | - ssl on; |
11 | | - ssl_certificate %ssl_pem%; |
12 | | - ssl_certificate_key %ssl_key%; |
| 12 | + location = /favicon.ico { |
| 13 | + log_not_found off; |
| 14 | + access_log off; |
| 15 | + } |
13 | 16 |
|
14 | | - if (!-f $request_filename){ |
15 | | - rewrite ^/([a-zA-Z0-9-]+)$ /$1.php last; |
16 | | - } |
| 17 | + location = /robots.txt { |
| 18 | + allow all; |
| 19 | + log_not_found off; |
| 20 | + access_log off; |
| 21 | + } |
17 | 22 |
|
18 | | - location / { |
19 | | - index index.php; |
| 23 | + location ~* "/\.(htaccess|htpasswd|git|svn|DS_Store)$" { |
| 24 | + deny all; |
| 25 | + } |
| 26 | + |
| 27 | + location ~ /(readme.html|license.txt) { |
| 28 | + deny all; |
| 29 | + } |
20 | 30 |
|
21 | | - location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ { |
22 | | - expires max; |
| 31 | + if (!-f $request_filename){ |
| 32 | + rewrite ^/([a-zA-Z0-9-]+)$ /$1.php last; |
| 33 | + } |
| 34 | + |
| 35 | + location / { |
| 36 | + try_files $uri $uri/ /index.php?$args; |
| 37 | + location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar|pdf)$ { |
| 38 | + expires 1d; |
23 | 39 | } |
24 | 40 |
|
25 | 41 | location ~ [^/]\.php(/|$) { |
26 | 42 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
27 | | - if (!-f $document_root$fastcgi_script_name) { |
28 | | - return 404; |
29 | | - } |
30 | | - |
31 | | - fastcgi_pass %backend_lsnr%; |
32 | | - fastcgi_index index.php; |
33 | | - include /etc/nginx/fastcgi_params; |
| 43 | + try_files $uri =404; |
| 44 | + fastcgi_pass %backend_lsnr%; |
| 45 | + fastcgi_index index.php; |
| 46 | + include /etc/nginx/fastcgi_params; |
34 | 47 | } |
35 | 48 |
|
36 | 49 | location /l/ { |
@@ -62,14 +75,14 @@ server { |
62 | 75 | alias %home%/%user%/web/%domain%/document_errors/; |
63 | 76 | } |
64 | 77 |
|
65 | | - location ~* "/\.(htaccess|htpasswd)$" { |
66 | | - deny all; |
67 | | - return 404; |
| 78 | + location /vstats/ { |
| 79 | + alias %home%/%user%/web/%domain%/stats/; |
| 80 | + include %home%/%user%/web/%domain%/stats/auth.conf*; |
68 | 81 | } |
69 | 82 |
|
70 | 83 | include /etc/nginx/conf.d/phpmyadmin.inc*; |
71 | 84 | include /etc/nginx/conf.d/phppgadmin.inc*; |
72 | 85 | include /etc/nginx/conf.d/webmail.inc*; |
73 | 86 |
|
74 | | - include %home%/%user%/conf/web/snginx.%domain%.conf*; |
| 87 | + include %home%/%user%/conf/web/nginx.%domain%.conf*; |
75 | 88 | } |
0 commit comments