Created
May 8, 2018 20:57
-
-
Save rolandinsh/b506ba8689f935561aa65514994d4410 to your computer and use it in GitHub Desktop.
nginx-le-https.conf
This file contains 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
# Let's Encrypt webroot and https-only server | |
# via https://community.letsencrypt.org/t/webroot-and-https-only-server-impossible/32506 | |
server { | |
# SSL configuration | |
# | |
listen *:443 ssl http2; | |
listen [::]:443 ssl http2; | |
......... | |
} | |
server { | |
listen *:80; | |
listen [::]:80; | |
server_name mywebsite.com www/mywebsite.com; | |
# ACME Challenge Rule | |
location /.well-known { | |
alias /var/www/mywebsite.com/.well-known; | |
allow all; | |
default_type "text/plain"; | |
autoindex on; | |
} | |
location / { | |
return 301 https://mywebsite.com$request_uri; | |
} | |
access_log /var/log/nginx/mywebsite.com-access.log; | |
error_log /var/log/nginx/mywebsite.com-error.log; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment