NEVER use SSL / TLS in outdated versions or insecure / oudated ciphers. Current state-of-the-art TLS Versions are TLSv1.2 and TLSv1.3. TLSv1.2 is only enabled for backwards compatibility. Ciphers are taken out of the guide. ```ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384;``` Are the recommended ciphers out of source 4 in combination of all other sources. source 1: https://www.linuxtechi.com/harden-secure-nginx-web-server-linux source 2: https://beaglesecurity.com/blog/article/nginx-server-security.html source 3: https://www.acunetix.com/blog/articles/tls-ssl-cipher-hardening/ source 4: https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html
58 lines
1.4 KiB
Smarty
58 lines
1.4 KiB
Smarty
upstream modoboa {
|
|
server unix:%uwsgi_socket_path fail_timeout=0;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name %hostname;
|
|
rewrite ^ https://$server_name$request_uri? permanent;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
listen [::]:443 ssl;
|
|
server_name %hostname;
|
|
root %app_instance_path;
|
|
|
|
ssl_certificate %tls_cert_file;
|
|
ssl_certificate_key %tls_key_file;
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_ciphers "ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384";
|
|
ssl_prefer_server_ciphers on;
|
|
ssl_session_cache shared:SSL:10m;
|
|
ssl_verify_depth 3;
|
|
ssl_dhparam /etc/nginx/dhparam.pem;
|
|
|
|
client_max_body_size 10M;
|
|
|
|
access_log /var/log/nginx/%{hostname}-access.log;
|
|
error_log /var/log/nginx/%{hostname}-error.log;
|
|
|
|
location /sitestatic/ {
|
|
try_files $uri $uri/ =404;
|
|
}
|
|
|
|
location /media/ {
|
|
try_files $uri $uri/ =404;
|
|
}
|
|
|
|
location ^~ /new-admin {
|
|
alias %{app_instance_path}/frontend/;
|
|
index index.html;
|
|
|
|
expires -1;
|
|
add_header Pragma "no-cache";
|
|
add_header Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0";
|
|
|
|
try_files $uri $uri/ /index.html = 404;
|
|
}
|
|
|
|
location / {
|
|
include uwsgi_params;
|
|
uwsgi_param UWSGI_SCRIPT instance.wsgi:application;
|
|
uwsgi_pass modoboa;
|
|
}
|
|
%{extra_config}
|
|
}
|