Skip to content

Commit 1a6d039

Browse files
Update default.stpl
1 parent 4473219 commit 1a6d039

File tree

1 file changed

+18
-37
lines changed

1 file changed

+18
-37
lines changed

install/deb/templates/mail/nginx/default.stpl

Lines changed: 18 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,31 @@
11
server {
22
listen %ip%:%proxy_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+
access_log /var/log/nginx/domains/%domain%.log combined;
9+
error_log /var/log/nginx/domains/%domain%.error.log error;
810

9-
error_log /var/log/nginx/domains/%domain%.error.log;
10-
access_log /var/log/nginx/domains/%domain%.access.log;
11-
12-
location / {
13-
proxy_pass http://%ip%:%web_port%;
14-
try_files $uri $uri/ /index.php?q=$uri&$args;
15-
alias /var/lib/roundcube/;
16-
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)$ {
17-
expires 7d;
18-
fastcgi_hide_header "Set-Cookie";
19-
}
20-
}
21-
22-
location ~ /(config|temp|logs) {
23-
deny all;
24-
return 404;
25-
}
26-
2711
location ~ /\.(?!well-known\/) {
2812
deny all;
2913
return 404;
3014
}
3115

32-
location ~ ^/(README.md|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
16+
location ~ ^/(README.md|config|temp|logs|bin|SQL|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
3317
deny all;
3418
return 404;
3519
}
3620

37-
location ~ ^/(bin|SQL)/ {
38-
deny all;
39-
return 404;
40-
}
41-
42-
location ~ /\. {
43-
return 404;
44-
deny all;
45-
access_log off;
46-
log_not_found off;
21+
location / {
22+
proxy_pass https://%ip%:%web_ssl_port%;
23+
try_files $uri $uri/ /index.php?q=$uri&$args;
24+
alias /var/lib/roundcube/;
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+
}
4729
}
4830

4931
location ~ ^/(.*\.php)$ {
@@ -52,19 +34,18 @@ server {
5234
fastcgi_index index.php;
5335
include fastcgi_params;
5436
fastcgi_param SCRIPT_FILENAME $request_filename;
55-
fastcgi_param HTTPS on;
5637
}
57-
38+
5839
error_page 403 /error/404.html;
5940
error_page 404 /error/404.html;
6041
error_page 500 502 503 504 505 /error/50x.html;
61-
42+
6243
location /error/ {
63-
alias /var/www/document_errors/;
44+
alias /var/www/document_errors/;
6445
}
6546

66-
location @fallback {
67-
proxy_pass http://%ip%:%web_port%;
47+
location @fallback {
48+
proxy_pass https://%ip%:%web_ssl_port%;
6849
}
6950

7051
include %home%/%user%/conf/mail/%root_domain%/%proxy_system%.conf_*;

0 commit comments

Comments
 (0)