Guten [Tageszeit], Forum
ich versuche zurzeit, eine Subdomain durch den HTTPS-Server der Hauptdomain auf einen weiteren HTTPS-Server im LAN umzuleiten. Das ganze wollte ich per Proxy mit VHosts in apache2 erledigen, was auf beiden Servern installiert ist. Das funktioniert für HTTP ganz gut, aber ich erhalte bei HTTPS folgenden Fehler im Browser:
|
Quellcode
|
1
2
3
4
5
6
|
Proxy Error
The proxy server received an invalid
response from an upstream server.
The proxy server could not handle the request GET /.
Reason: Error reading from remote server
|
Die SSL-Zertifikate wurden von LetsEncrypt für beide Server bereits auf dem Hauptserver erstellt und in die sites-enabled eingearbeitet. Meine Frage nun: was mache ich falsch?
000-default.conf: (HTTP; Hauptserver)
|
Quellcode
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#Listen 80
<VirtualHost *:80>
ServerAdmin XXX
DocumentRoot /var/www/html/joomla/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =domain.de
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:80>
ServerAdmin XXX
ServerName nextcloud.domain.de
ProxyPreserveHost On
ProxyPass / http://192.168.178.53:80/
ProxyPassReverse / http://192.168.178.53:80/
RewriteEngine on
RewriteCond %{SERVER_NAME} =nextclouddomain.de
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
|
000-default-le-ssl.conf (HTTPS; Hauptserver)
|
Quellcode
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin XXX
DocumentRoot /var/www/html/joomla/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ServerName domain.de
SSLCertificateFile /etc/letsencrypt/live/domain/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/domain/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
<VirtualHost *:443>
ServerAdmin XXX
ServerName nextcloud.domain.de
ProxyPreserveHost On
ProxyPass / https://192.168.178.53:443/
ProxyPassReverse / https://192.168.178.53:443/
SSLCertificateFile /etc/letsencrypt/live/nextcloud.domain.de/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/nextcloud.domain.de/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.confSSLProxyEngine On
</VirtualHost>
</IfModule>
|
Die Konfiguration auf dem zweiten Rechner, der nur im LAN / per Umleitung erreichbar ist:
|
Quellcode
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
Listen 443
Listen 80
<VirtualHost *:80>
ServerAdmin "XXX"
DocumentRoot "/var/www/nextcloud/nextcloud"
ServerName "nextcloud.domain.de"
<Directory "/var/www/nextcloud/nextcloud/">
AllowOverride All
Options -Indexes +FollowSymlinks
# <IfModule mod_dav.c>
# Dav off
# </IfModule>
SetEnv HOME "XXX"
SetEnv HTTP_HOME "XXX"
</Directory>
<Directory "/XXX">
Require all denied
</Directory>
<FilesMatch \.php$>
SetHandler "proxy:unix:/run/php/php7.0-fpm.nextcloud.sock|fcgi://localhost"
</FilesMatch>
<Location "/">
Order Deny,Allow
Deny from all
Allow from all
</Location>
</virtualhost>
<ifModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin XXX
DocumentRoot /XXX
ServerName nextcloud.domain.de
</VirtualHost>
</IfModule>
|
Ich hoffe, jemand kann hier helfen. Ich hab es schonmal zum laufen gebracht, allerdings sind die Konfigurationen verloren gegangen
LG Max