49 lines
1.5 KiB
Plaintext
49 lines
1.5 KiB
Plaintext
# Configuration for mail.forsen-cock.dedyn.io
|
|
# Add this to your existing Nginx configuration
|
|
|
|
server {
|
|
listen 80;
|
|
server_name mail.forsen-cock.dedyn.io;
|
|
|
|
# Redirect all HTTP traffic to HTTPS
|
|
location / {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
server_name mail.forsen-cock.dedyn.io;
|
|
|
|
# SSL configuration
|
|
ssl_certificate /etc/nginx/ssl/mail.forsen-cock.dedyn.io.crt;
|
|
ssl_certificate_key /etc/nginx/ssl/mail.forsen-cock.dedyn.io.key;
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_prefer_server_ciphers on;
|
|
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
|
|
ssl_session_cache shared:SSL:10m;
|
|
ssl_session_timeout 10m;
|
|
|
|
# Proxy to Roundcube webmail
|
|
location / {
|
|
proxy_pass http://localhost:8000;
|
|
proxy_set_header Host $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;
|
|
|
|
# WebSocket support (if needed)
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
client_max_body_size 100M; # Allow larger attachments
|
|
}
|
|
|
|
# Security headers
|
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
add_header X-XSS-Protection "1; mode=block" always;
|
|
}
|