# Apache2 configuration for a virtualhost proxied to a Docker service. # Uses https://github.com/acmesh-official/acme.sh to manage SSL certificates. ServerAdmin webmaster@$PAR_SERVERNAME ServerName $PAR_SERVERNAME # ServerAlias $PAR_SERVERNAMES DocumentRoot /var/www/html # Common log settings. ErrorLog $PAR_SERVICE/logs/web/error.log CustomLog $PAR_SERVICE/logs/web/access.log combined # Custom error messages. ErrorDocument $response "Sorry try http://$PAR_SERVERNAME/$PAR_LOCATION instead." ErrorDocument $response "Sorry something went wrong. Try again a bit later.
\ You may report this at webmaster@$PAR_SERVERNAME.
"
# Permanent redirect to https. # RewriteEngine On # RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L] # No static service. # Sequence matters: http://httpd.apache.org/docs/2.4/sections.html#file-and-web # # Require all denied # # Custom error message. # # Use try_other 403 # Use try_other 404 # # # Let's Encrypt (acme.sh) support. Require all granted ProxyPreserveHost On ProxyPass http://$PAR_ACMEHOST:$PAR_ACMEPORT/ ProxyPassReverse http://$PAR_ACMEHOST:$PAR_ACMEPORT/ # Custom error message. Use try_later 500 Use try_later 502 Use try_later 503 Use try_later 504 # Custom error message. Use try_other 403 Use try_other 404 Require all granted ProxyPreserveHost On ProxyPass http://$PAR_PROXYHOST:$PAR_PROXYPORT/$PAR_LOCATION ProxyPassReverse http://$PAR_PROXYHOST:$PAR_PROXYPORT/$PAR_LOCATION # Custom error message. Use try_later 500 Use try_later 502 Use try_later 503 Use try_later 504 # Custom error message. Use try_later 403 Use try_later 404 # XSS protection Header set X-Frame-Options SAMEORIGIN Header set X-Content-Type-Options nosniff