Last active
January 27, 2019 23:21
-
-
Save schuerg/a617d1f5197457bbfbb21a5c78338914 to your computer and use it in GitHub Desktop.
Nginx config for Let's Encrypt renewal challenges
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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