Skip to content

Instantly share code, notes, and snippets.

@SarasArya
Created March 10, 2019 11:18
Show Gist options
  • Save SarasArya/18fc417d8ba807408b477d5b726412b4 to your computer and use it in GitHub Desktop.
Save SarasArya/18fc417d8ba807408b477d5b726412b4 to your computer and use it in GitHub Desktop.
Nginx conf for static site serving
server {
listen 80;
server_name www.example.com example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name www.example.com;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
location / {
root /home/ubuntu/example-website;
index index.html;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment