scripts/nginx_config_maker/prod/lxc_containers/mattermost
2023-06-15 19:42:12 +02:00

41 lines
1.5 KiB
Plaintext

#mattermost
proxy_cache_path /var/cache/nginx-mattermost levels=1:2 keys_zone=mattermost_cache:10m max_size=3g inactive=120m use_temp_path=off;
server {
listen localhost:80;
listen [::]:80;
server_name chat.cipherbliss.com;
return 301 https://chat.cipherbliss.com$request_uri;
}
server{
listen localhost:433 ssl http2;
listen [::]:433 ssl http2;
server_name chat.cipherbliss.com;
ssl_certificate /etc/letsencrypt/live/chat.cipherbliss.com/fullchain.pem; # managed by Certb$
ssl_certificate_key /etc/letsencrypt/live/chat.cipherbliss.com/privkey.pem; # managed by Cer$
ssl_session_timeout 1d;
ssl_protocols TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
ssl_prefer_server_ciphers on;
# HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months)
add_header Strict-Transport-Security max-age=15768000;
# OCSP Stapling ---
# fetch OCSP records from URL in ssl_certificate and cache them
ssl_stapling on;
ssl_stapling_verify on;
location ~ {
proxy_pass http://127.0.0.1:8065;
}
location ~ /api/v[0-9]+/(users/)?websocket$ {
proxy_set_header Upgrade $http_upgrade;
}
location / {
proxy_http_version 1.1;
}
}