Skip to content

Instantly share code, notes, and snippets.

@mrngm
Created May 27, 2018 10:46
Show Gist options
  • Save mrngm/5426656caa13ac103c85e319a20c5790 to your computer and use it in GitHub Desktop.
Save mrngm/5426656caa13ac103c85e319a20c5790 to your computer and use it in GitHub Desktop.
location /.well-known/acme-challenge/ {
alias /var/www/challenges/.well-known/acme-challenge/;
try_files $uri @forward_https;
}
location @forward_https {
return 301 https://$host$request_uri;
}
location / {
return 301 https://$host$request_uri;
}
server {
server_name server.tld;
listen [::]:80;
include hooks/letsencrypt.conf;
}
server {
server_name server.tld;
listen [::]:443 ssl; # http2
ssl on;
ssl_certificate /etc/letsencrypt/live/server.tld/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/server.tld/privkey.pem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment