Created
January 13, 2018 11:15
-
-
Save TobiX/63b698db7de37ec7d09f380ea0da0a24 to your computer and use it in GitHub Desktop.
Generic ACME/HTTPS vhost
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
<VirtualHost 192.168.99.99:80 [2001:0002:6c::430]:80> | |
ServerName example.com | |
ServerAlias www.example.com host1.example.com host2.example.com | |
ServerAdmin [email protected] | |
AddDefaultCharset utf-8 | |
DocumentRoot /home/certmaster/webroot/ | |
RewriteEngine on | |
RewriteRule ^/.well-known/ - [L] | |
RewriteRule ^/(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] | |
</VirtualHost> |
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
server { | |
listen 80; | |
listen [::]:80 ipv6only=on; | |
server_name www.example.com example.com host1.example.com host2.example.com; | |
location /.well-known/acme-challenge/ { | |
root /home/certmaster/webroot/; | |
try_files $uri =404; | |
} | |
location / { | |
return 301 https://$host$request_uri; | |
} | |
# http://www.gnuterrypratchett.com/#nginx | |
add_header X-Clacks-Overhead "GNU Terry Pratchett"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment