2021-02-22 05:14:32 +00:00
|
|
|
server {
|
2021-04-01 16:13:49 +00:00
|
|
|
listen [::]:443 default_server ssl;
|
|
|
|
listen 443 default_server ssl;
|
|
|
|
listen [::]:80 default_server;
|
|
|
|
listen 80 default_server;
|
|
|
|
server_name _;
|
2021-02-22 05:14:32 +00:00
|
|
|
|
2021-04-01 16:13:49 +00:00
|
|
|
access_log /var/log/nginx/default.access.log;
|
|
|
|
error_log /var/log/nginx/default.error.log;
|
2021-02-22 05:14:32 +00:00
|
|
|
|
2021-04-01 16:13:49 +00:00
|
|
|
# Generate a self-signed cert and key: "sudo openssl req -x509 -nodes -days 3650 -newkey rsa:4096 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt"
|
|
|
|
ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
|
|
|
|
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
|
2021-02-22 05:14:32 +00:00
|
|
|
|
2024-10-30 05:06:19 +00:00
|
|
|
# Generate a strong DH Param (can take 10 mins): "sudo openssl dhparam -out /etc/ssl/dhparam.pem 4096"
|
2021-04-01 16:13:49 +00:00
|
|
|
ssl_dhparam /etc/ssl/dhparam.pem;
|
2021-02-22 05:14:32 +00:00
|
|
|
|
2021-04-01 16:13:49 +00:00
|
|
|
ssl_protocols TLSv1.3 TLSv1.2 TLSv1.1;
|
|
|
|
ssl_prefer_server_ciphers on;
|
|
|
|
ssl_ciphers EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA512:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:ECDH+AESGCM:ECDH+AES256:DH+AESGCM:DH+AES256:RSA+AESGCM:!aNULL:!eNULL:!LOW:!RC4:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS;
|
2021-02-22 05:14:32 +00:00
|
|
|
|
2021-04-01 16:13:49 +00:00
|
|
|
ssl_session_cache shared:TLS:2m;
|
2021-02-22 05:14:32 +00:00
|
|
|
|
2022-02-05 14:01:24 +00:00
|
|
|
# Everything is a 404
|
|
|
|
location / {
|
|
|
|
return 404;
|
2021-04-01 16:13:49 +00:00
|
|
|
}
|
2021-02-22 05:14:32 +00:00
|
|
|
}
|