ubuntuusers.de

Apache2 - ReverseProxy per HTTPS

Status: Gelöst | Ubuntu-Version: Ubuntu 16.04 (Xenial Xerus)
Antworten |

n0bbi Team-Icon

Avatar von n0bbi

Anmeldungsdatum:
16. Oktober 2004

Beiträge: 492

Wohnort: Nürnberg

Hallo zusammen,

ich habe heute für meinen Apache2 ein Lets Encrypt Zertifikat erstellt und das hat auch einwandfrei geklappt. Nun möchte ich per ReverseProxy einen dahinterliegenden Webdienst erreichbar machen. Anbindung per HTTP, von außen ausschließlich per HTTPS erreichbar. (Hoffe das ist verständlich)

Meine Config schaut wie folgt aus:

<IfModule mod_ssl.c>
        <VirtualHost _default_:443>
                ServerAdmin webmaster@localhost
                DocumentRoot /var/www/html

                ErrorLog ${APACHE_LOG_DIR}/error.log
                CustomLog ${APACHE_LOG_DIR}/access.log combined

                SSLEngine on

                SSLCertificateFile      /etc/ssl/certs/ssl-cert-snakeoil.pem
                SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

 
                <FilesMatch "\.(cgi|shtml|phtml|php)$">
                                SSLOptions +StdEnvVars
                </FilesMatch>
                <Directory /usr/lib/cgi-bin>
                                SSLOptions +StdEnvVars
                </Directory>

 
                ProxyRequests Off
                ProxyPreserveHost On
                RequestHeader set X-Forwarded-Proto "https"
                SSLProxyEngine On
                <Location /fhem>
                         ProxyPass http://localhost:8083/fhem
                         ProxyPassReverse http://localhost:8083/fhem
                </Location>

        </VirtualHost>
</IfModule>

Leider bekomme ich beim Aufruf von https://meinedomain.de/fhem einen 404.

Ohne HTTPS (http://meinedomain.de/fhem) funktioniert es, hier die entsprechende Config:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined


        <Location /fhem>
             ProxyPass http://localhost:8083/fhem
             ProxyPassReverse http://localhost:8083/fhem
        </Location>
</VirtualHost>

Vielleicht kann mir jemand auf die Sprünge helfen? Oder stelle ich mir das zu einfach vor?

Vielen Dank!

[EDIT] Ich schäme mich jetzt ein bisschen, aber ich hab es hingebracht. Die Konfiguration war zwar richtig, jedoch in der falschen *.conf datei. Sorry, das System habe ich noch nicht ganz durchschaut...

Antworten |