Skip to content

Instantly share code, notes, and snippets.

@schuerg
Last active January 27, 2019 23:21
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 schuerg/a617d1f5197457bbfbb21a5c78338914 to your computer and use it in GitHub Desktop.
Save schuerg/a617d1f5197457bbfbb21a5c78338914 to your computer and use it in GitHub Desktop.
Nginx config for Let's Encrypt renewal challenges
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name example.com *.example.com blub.example.com;
# No redirect to HTTPS for Let's Encrypt renewal challenges
location ~ /.well-known {
root /var/www/html;
allow all;
}
# Redirect to HTTPS for all other locations
location / {
#return 301 https://$server_name$request_uri;
return 301 https://$host$request_uri;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment