linux  webserver  apache

apache reverse proxy

Notiz für einen reverse Proxy, also eine weiterleitung ...

sudo a2enmod proxy proxy_http proxy_wstunnel
sudo service apache2 restart

 sudo nano /etc/apache2/sites-available/000-default-ssl.conf
<VirtualHost *:443>

	# ...

	# zusätzlich zur Config hinzufügen!
        # If you plan to proxy to a HTTPS host:
        #SSLProxyEngine On
        # If you plan to proxy to an untrusted HTTPS host:
        #SSLProxyVerify none
        #SSLProxyCheckPeerCN off
        #SSLProxyCheckPeerName off
        #SSLProxyCheckPeerExpire off
        #
        ProxyPreserveHost On
        ProxyAddHeaders On
        RequestHeader set X-Forwarded-Port "443"
        RequestHeader set X-Forwarded-Proto "https"
        ProxyPass / http://127.0.0.1:5081/
        ProxyPassReverse / http://127.0.0.1:5081/

</VirtualHost>

# Weiter Hosts müssen dann zwingend ServerName und ServerAlias enthalten!
#<VirtualHost *:443>
#        ServerAdmin webmaster@localhost
#        ServerName www.l337.l11
#        ServerAlias l337.l11 *.l337.l11

sudo a2ensite 000-default-ssl.conf 
 
sudo systemctl reload apache2
 apache   linux   webserver