Last active
December 15, 2021 03:20
-
-
Save fumiyas/0a98fe06590065dbdb9bcfe01d97f4fb to your computer and use it in GitHub Desktop.
Apache HTTPD: Default virtualhost definition to deny access to an unexpected server name, but ACME
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
Alias /.well-known/acme-challenge/ /var/www/acme/.well-known/acme-challenge/ | |
<Directory /var/www/acme/.well-known/acme-challenge> | |
Require all granted | |
</Directory> | |
<VirtualHost 127.0.0.1:80> | |
<IfModule status_module> | |
<Location /server-status> | |
Require ip 127.0.0.1 ::1 | |
SetHandler server-status | |
</Location> | |
</IfModule> | |
<IfModule info_module> | |
<Location /server-info> | |
Require ip 127.0.0.1 ::1 | |
SetHandler server-info | |
</Location> | |
</IfModule> | |
</VirtualHost> | |
<VirtualHost *:80> | |
RedirectMatch 503 ^(?!/\.well-known/) | |
ErrorDocument 503 "<html><head><title>503 Service Unavailable</title></head><body><h1>Service Unavailable</h1><p>The requested server name is unknown on this host (your-www-server-nodename.example.com, protocol http, port *:80). Please confirm the server name in the URL.</p></body></html>" | |
DocumentRoot /var/www/empty | |
</VirtualHost> | |
<VirtualHost *:443> | |
SSLEngine On | |
SSLCertificateFile /etc/apache2/certs/unknown.crt | |
SSLCertificateKeyFile /etc/apache2/private/unknown.key | |
RedirectMatch 503 ^(?!/\.well-known/) | |
ErrorDocument 503 "<html><head><title>503 Service Unavailable</title></head><body><h1>Service Unavailable</h1><p>The requested server name is unknown on this host (your-www-server-nodename.example.com, protocol https, port *:443). Please confirm the server name in the URL.</p></body></html>" | |
DocumentRoot /var/www/empty | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment