11server {
22 listen %ip%:%web_ssl_port% ssl http2;
33 server_name %domain% %alias%;
4- ssl_certificate %ssl_pem%;
5- ssl_certificate_key %ssl_key%;
4+ ssl_certificate %ssl_pem%;
5+ ssl_certificate_key %ssl_key%;
66 root /var/lib/roundcube;
77 index index.php index.html index.htm;
8-
9- error_log /var/log/nginx/domains/%domain%.error.log;
10- access_log /var/log/nginx/domains/%domain%.access.log;
8+ access_log /var/log/nginx/domains/%domain%.log combined;
9+ error_log /var/log/nginx/domains/%domain%.error.log error;
1110
12- location =/ {
13- try_files $uri $uri/ /index.php?q=$uri&$args;
14- }
15-
16- location / {
17- 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)$ {
18- expires 7d;
19- fastcgi_hide_header "Set-Cookie";
20- }
21- }
22-
23- location ~ /(config|temp|logs) {
24- deny all;
25- return 404;
26- }
27-
11+ include %home%/%user%/conf/mail/%root_domain%/nginx.forcessl.conf*;
12+
2813 location ~ /\.(?!well-known\/) {
2914 deny all;
3015 return 404;
3116 }
3217
33- location ~ ^/(README.md|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
34- deny all;
35- return 404;
36- }
37-
38- location ~ ^/(bin|SQL)/ {
18+ location ~ ^/(README.md|config|temp|logs|bin|SQL|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
3919 deny all;
4020 return 404;
4121 }
4222
43- location ~ /\. {
44- return 404;
45- deny all;
46- access_log off;
47- log_not_found off;
23+ location / {
24+ try_files $uri $uri/ /index.php?q=$uri&$args;
25+ 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)$ {
26+ expires 7d;
27+ fastcgi_hide_header "Set-Cookie";
28+ }
4829 }
4930
5031 location ~ ^/(.*\.php)$ {
@@ -53,15 +34,14 @@ server {
5334 fastcgi_index index.php;
5435 include fastcgi_params;
5536 fastcgi_param SCRIPT_FILENAME $request_filename;
56- fastcgi_param HTTPS on;
5737 }
5838
5939 error_page 403 /error/404.html;
6040 error_page 404 /error/404.html;
6141 error_page 500 502 503 504 505 /error/50x.html;
6242
6343 location /error/ {
64- alias /var/www/document_errors/;
44+ alias /var/www/document_errors/;
6545 }
6646
6747 include %home%/%user%/conf/mail/%root_domain%/%web_system%.conf_*;
0 commit comments