feat: add example virtual host conf file for apache2 proxy

This commit is contained in:
dancingCycle 2022-05-06 15:19:51 +02:00
parent 7649fdf640
commit db5df7e8f8
1 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,51 @@
<VirtualHost *:80>
RewriteEngine On
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
<VirtualHost *:443>
ServerAdmin admin@foo.bar
ServerName foo.bar
ServerAlias www.foo.bar
#proxy settings
ProxyPreserveHost On
ProxyAddHeaders Off
ProxyRequests Off
#set proxy so that a web service can use a server running on port 54321
ProxyPass /route https://foo.bar:54321
ProxyPassReverse /route https://foo.bar:54321
DocumentRoot /var/www/foo.bar/public_html
<Directory /var/www/foo.bar/public_html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
ErrorLog ${APACHE_LOG_DIR}/foo.bar-error.log
CustomLog ${APACHE_LOG_DIR}/foo.bar-access.log combined
SSLProxyEngine On
SSLEngine On
SSLCertificateFile /etc/<path>/cert.pem
SSLCertificateKeyFile /etc/<path>/private.key
# enable HTTP/2, if available
Protocols h2 http/1.1
# HTTP Strict Transport Security (mod_headers is required) (63072000 seconds)
Header always set Strict-Transport-Security "max-age=63072000"
# intermediate configuration
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
SSLHonorCipherOrder off
SSLSessionTickets off