Skip to content

Instantly share code, notes, and snippets.

@dgacitua
Created March 20, 2021 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgacitua/19ef2d1b8f594b2e45d176bc873b0357 to your computer and use it in GitHub Desktop.
Save dgacitua/19ef2d1b8f594b2e45d176bc873b0357 to your computer and use it in GitHub Desktop.
Nginx configuration file for a static HTML server using a secure connection with Let's Encrypt
server {
listen 80;
server_name mydomain.org www.mydomain.org;
return 301 https://mydomain.org$request_uri;
}
server {
listen 443 ssl default_server;
server_name mydomain.org www.mydomain.org;
root /home/myuser/html;
index index.html;
try_files $uri /index.html;
ssl_certificate /etc/letsencrypt/live/mydomain.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mydomain.org/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
ssl_session_timeout 5m;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment