Skip to content

Instantly share code, notes, and snippets.

@TobiX
Created January 13, 2018 11:15
Show Gist options
  • Save TobiX/63b698db7de37ec7d09f380ea0da0a24 to your computer and use it in GitHub Desktop.
Save TobiX/63b698db7de37ec7d09f380ea0da0a24 to your computer and use it in GitHub Desktop.
Generic ACME/HTTPS vhost
<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>
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