|
1 | 1 | server { |
2 | | - listen %ip%:%proxy_ssl_port% ssl http2; |
3 | | - server_name %domain_idn% %alias_idn%; |
4 | | - root /var/lib/roundcube; |
5 | | - index index.php index.html index.htm; |
6 | | - access_log /var/log/nginx/domains/%domain%.log combined; |
7 | | - error_log /var/log/nginx/domains/%domain%.error.log error; |
8 | | - |
9 | | - ssl_certificate %ssl_pem%; |
10 | | - ssl_certificate_key %ssl_key%; |
11 | | - ssl_stapling on; |
12 | | - ssl_stapling_verify on; |
13 | | - |
14 | | - location ~ /\.(?!well-known\/) { |
15 | | - deny all; |
16 | | - return 404; |
17 | | - } |
18 | | - |
19 | | - location ~ ^/(README.md|config|temp|logs|bin|SQL|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ { |
20 | | - deny all; |
21 | | - return 404; |
22 | | - } |
23 | | - |
24 | | - location / { |
25 | | - proxy_pass https://%ip%:%web_ssl_port%; |
26 | | - try_files $uri $uri/ =404; |
27 | | - alias /var/lib/roundcube/; |
28 | | - location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|webp|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ { |
29 | | - expires 7d; |
30 | | - fastcgi_hide_header "Set-Cookie"; |
31 | | - } |
32 | | - } |
33 | | - |
34 | | - location /error/ { |
35 | | - alias /var/www/document_errors/; |
36 | | - } |
37 | | - |
38 | | - location @fallback { |
39 | | - proxy_pass https://%ip%:%web_ssl_port%; |
40 | | - } |
41 | | - |
42 | | - proxy_hide_header Upgrade; |
43 | | - |
44 | | - include %home%/%user%/conf/mail/%root_domain%/%proxy_system%.ssl.conf_*; |
| 2 | + listen %ip%:%proxy_ssl_port% ssl; |
| 3 | + server_name %domain_idn% %alias_idn%; |
| 4 | + root /var/lib/roundcube; |
| 5 | + index index.php index.html index.htm; |
| 6 | + access_log /var/log/nginx/domains/%domain%.log combined; |
| 7 | + error_log /var/log/nginx/domains/%domain%.error.log error; |
| 8 | + |
| 9 | + ssl_certificate %ssl_pem%; |
| 10 | + ssl_certificate_key %ssl_key%; |
| 11 | + ssl_stapling on; |
| 12 | + ssl_stapling_verify on; |
| 13 | + |
| 14 | + # TLS 1.3 0-RTT anti-replay |
| 15 | + if ($anti_replay = 307) { return 307 https://$host$request_uri; } |
| 16 | + if ($anti_replay = 425) { return 425; } |
| 17 | + |
| 18 | + location ~ /\.(?!well-known\/) { |
| 19 | + deny all; |
| 20 | + return 404; |
| 21 | + } |
| 22 | + |
| 23 | + location ~ ^/(README.md|config|temp|logs|bin|SQL|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ { |
| 24 | + deny all; |
| 25 | + return 404; |
| 26 | + } |
| 27 | + |
| 28 | + location / { |
| 29 | + alias /var/lib/roundcube/; |
| 30 | + |
| 31 | + try_files $uri $uri/ =404; |
| 32 | + |
| 33 | + proxy_pass https://%ip%:%web_ssl_port%; |
| 34 | + |
| 35 | + location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|webp|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ { |
| 36 | + expires 7d; |
| 37 | + fastcgi_hide_header "Set-Cookie"; |
| 38 | + } |
| 39 | + } |
| 40 | + |
| 41 | + location @fallback { |
| 42 | + proxy_pass https://%ip%:%web_ssl_port%; |
| 43 | + } |
| 44 | + |
| 45 | + location /error/ { |
| 46 | + alias /var/www/document_errors/; |
| 47 | + } |
| 48 | + |
| 49 | + proxy_hide_header Upgrade; |
| 50 | + |
| 51 | + include %home%/%user%/conf/mail/%root_domain%/%proxy_system%.ssl.conf_*; |
45 | 52 | } |
0 commit comments