parent
72191eee21
commit
89d4c12cb0
1 changed files with 76 additions and 0 deletions
@ -0,0 +1,76 @@ |
|||||||
|
server { |
||||||
|
listen 80; |
||||||
|
listen [::]:80; |
||||||
|
|
||||||
|
server_name mail.example.com webmail.example.com autodiscover.* autoconfig.*; |
||||||
|
|
||||||
|
;location ^~ /.well-known/acme-challenge/ { |
||||||
|
allow all; |
||||||
|
root /var/lib/letsencrypt/; |
||||||
|
default_type "text/plain"; |
||||||
|
try_files $uri =404; |
||||||
|
} |
||||||
|
|
||||||
|
return 301 https://$host$request_uri; |
||||||
|
} |
||||||
|
|
||||||
|
server { |
||||||
|
listen 443 ssl http2; |
||||||
|
listen [::]:443 ssl http2; |
||||||
|
|
||||||
|
server_name mail.example.com webmail.example.com autodiscover.* autoconfig.*; |
||||||
|
|
||||||
|
ssl_certificate /opt/mailcow-dockerized/data/assets/ssl/fullchain.pem; |
||||||
|
ssl_certificate_key /opt/mailcow-dockerized/data/assets/ssl/key.pem; |
||||||
|
ssl_dhparam /opt/mailcow-dockerized/data/assets/ssl/dhparams.pem; |
||||||
|
ssl_session_timeout 1d; |
||||||
|
ssl_session_cache shared:SSL:10m; |
||||||
|
ssl_session_tickets off; |
||||||
|
|
||||||
|
ssl_protocols TLSv1.2 TLSv1.3; |
||||||
|
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384; |
||||||
|
ssl_prefer_server_ciphers off; |
||||||
|
|
||||||
|
ssl_stapling on; |
||||||
|
ssl_stapling_verify on; |
||||||
|
ssl_trusted_certificate /opt/mailcow-dockerized/data/assets/ssl/chain.pem; |
||||||
|
resolver 1.1.1.1:53 1.0.0.1:53 '[2606:4700:4700::1111]:53' '[2606:4700:4700::1001]:53' valid=300s; |
||||||
|
resolver_timeout 30s; |
||||||
|
|
||||||
|
add_header X-Frame-Options "SAMEORIGIN" always; |
||||||
|
add_header X-XSS-Protection "1; mode=block" always; |
||||||
|
add_header X-Content-Type-Options "nosniff" always; |
||||||
|
add_header Referrer-Policy "strict-origin-when-cross-origin"; |
||||||
|
add_header Content-Security-Policy "upgrade-insecure-requests; default-src https:" always; |
||||||
|
add_header Feature-policy "accelerometer 'none'; camera 'none'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; payment 'none'" always; |
||||||
|
|
||||||
|
location ^~ /.well-known/acme-challenge/ { |
||||||
|
allow all; |
||||||
|
root /var/lib/letsencrypt/; |
||||||
|
default_type "text/plain"; |
||||||
|
try_files $uri =404; |
||||||
|
} |
||||||
|
|
||||||
|
location /Microsoft-Server-ActiveSync { |
||||||
|
proxy_pass http://127.0.0.1:8080/Microsoft-Server-ActiveSync; |
||||||
|
proxy_set_header Host $http_host; |
||||||
|
proxy_set_header X-Real-IP $remote_addr; |
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
||||||
|
proxy_set_header X-Forwarded-Proto $scheme; |
||||||
|
proxy_connect_timeout 75; |
||||||
|
proxy_send_timeout 3650; |
||||||
|
proxy_read_timeout 3650; |
||||||
|
proxy_buffers 64 256k; |
||||||
|
client_body_buffer_size 512k; |
||||||
|
client_max_body_size 0; |
||||||
|
} |
||||||
|
|
||||||
|
location / { |
||||||
|
proxy_pass http://127.0.0.1:8080/; |
||||||
|
proxy_set_header Host $http_host; |
||||||
|
proxy_set_header X-Real-IP $remote_addr; |
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
||||||
|
proxy_set_header X-Forwarded-Proto $scheme; |
||||||
|
client_max_body_size 0; |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue