Skip to content

Instantly share code, notes, and snippets.

@demidovsky
Created September 27, 2019 10:46
Show Gist options
  • Select an option

  • Save demidovsky/f783609bf12a552bdfbb78f2badf52f7 to your computer and use it in GitHub Desktop.

Select an option

Save demidovsky/f783609bf12a552bdfbb78f2badf52f7 to your computer and use it in GitHub Desktop.
nginx + certbot (letsencrypt) config example
#/etc/nginx/sites-enabled/default
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl ipv6only=on;
server_name EXAMPLE.COM;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
location / {
try_files $uri $uri/ =404;
}
ssl_certificate /etc/letsencrypt/live/EXAMPLE.COM/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/EXAMPLE.COM/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment