Created
February 21, 2018 20:35
-
-
Save llaumgui/9698cd4f08f9f84510007a5d66b132dd to your computer and use it in GitHub Desktop.
redirect all http queries to https and allow Let's encrypt challenge.
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
# | |
# HTTP: Let's encrypt + redirect on HTTPs | |
# | |
<VirtualHost _default_:80> | |
ServerAdmin [email protected] | |
### Let's encrypt | |
Alias /.well-known/acme-challenge/ /var/www/challenges/ | |
<Directory "/var/www/challenges"> | |
# Allow open access: | |
Require all granted | |
</Directory> | |
### Redirect to HTTPs | |
RewriteEngine on | |
RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/ | |
RewriteRule (.*) https://%{HTTP_HOST}$1 [R=301,L] | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment