Proxmox über Apache als Reverseproxy

Volker1

Active Member
May 6, 2019
31
0
26
58
Hallo, auf meiner VM soll nicht nur Proxmox laufen sondern auch weitere Anwendungen. Deshalb suche ich nach einer Möglichkeit, über Apache einen Reverseproxy zu bauen, der z. B. über die URL: https://my.example.com/proxmox:443 den Proxmox-Server auf https://localhost:8006 aufruft.

Dies hier ist der erste Block in der Apache-Config:
<Location /proxmox>
ProxyPass https://localhost:8006/
ProxyPassReverse https://localhost:8006/
Order allow,deny
allow from all
</Location>

Man sieht in den Logs "GET /proxmox HTTP/1.1" 200 ...", dass dieser Block funktioniert. Dann folgen aber weitere Logeinträge, die zeigen, dass noch etwas in der Apachekonfig zu fehlen scheint:
"GET /proxmoxlib.js 404 ..."
"GET /pve2/css/ext6-pmg.css 404 ..."
"GET /pve2/ext6/locale/locale-en.js 404..."
"GET /pve2/ext6/ext-all.js 404 ..."
"GET /fontawesome/css/font-awesome.css 404 ..."
"GET /pve2/ext6/crisp/resources/charts-all.css 404 ..."
"GET /pve2/ext6/charts.js 404 ..."
"GET /pve2/ext6/theme-crisp/resources/theme-crisp-all.css 404 ..."
"GET /pve2/js/pmgmanagerlib.js 404 ..."

Dies habe ich schon erfolglos versucht:
https://forum.proxmox.com/threads/proxmox-ve-5-2-1-through-apache-2-4-25-proxy.44408/
https://forum.proxmox.com/threads/working-novnc-with-reverse-proxy-on-5-1.43644/

Hat jemand einen Tipp für mich?
 
Last edited:
Den Beitrag habe ich auch gefunden und für Apache interpretiert. Leider geht es nicht.
 
Ich hatte schon beide Endungen (mit und ohne "/" am Ende) versucht. Ich hatte auch eine Regel eingebaut, die automatisch ein "/" ans Ende der URL setzt, wenn es kein file ist. Und dann die "location /proxmox/" verwendet.

IDie statische Weiterleitung funktioniert (http code 200), aber die Weiterleitung danach geht nicht. Es sind danach nur Fehler im logfile (http code 404).

Ich prüfe mal noch deinen Link.

Grüße
Volker1
 
Last edited:
Mit deinem Link
https://serverfault.com/questions/5...ve-urls-correctly-with-a-reverse-proxy/561897
bin ich weiter gekommen.

Der erste Logeintrag im access.log ist wie bisher http-code 200. Nach der Änderung gemäß den Empfehlungen unter dem Link sind die folgenden Logeinträge nun nicht mehr http-code 404 sondern 502.

Ich habe tcpdump zum Mithören laufen lassen und man sieht 15 Interaktionen auf Port 8006, wenn man die gewünschte URL in den Browser eingibt. Das Browserfester bleibt aber leer. Jetzt wäre es interessant, zu wissen, wie ich den Fehler 502 debuggen könnte ...
 
was sagen denn die apache-logs? (/var/log/apache/*log)
 
Ich habe den Proxy mittlerweile so konfiguriert:
ProxyPass /proxmox/ https://localhost:8006/
ProxyPassReverse /proxmox/ https://localhost:8006/
und komme bis zur Anmeldemaske. Hier die zugehörigen Logeinträge:
GET /proxmox/ HTTP/1.1" 200
GET /proxmox/pve2/ext6/crisp/resources/charts-all.css HTTP/1.1" 200
GET /proxmox/pve2/css/ext6-pmg.css HTTP/1.1" 200
GET /proxmox/pve2/ext6/locale/locale-en.js HTTP/1.1" 200
GET /proxmox/pve2/js/pmgmanagerlib.js HTTP/1.1" 200
GET /proxmox/proxmoxlib.js HTTP/1.1" 200
GET /proxmox/pve2/ext6/ext-all.js HTTP/1.1" 200
GET /proxmox/pve2/ext6/charts.js HTTP/1.1" 200
GET /proxmox/pve2/ext6/theme-crisp/resources/theme-crisp-all.css HTTP/1.1" 200
GET /proxmox/fontawesome/css/font-awesome.css HTTP/1.1" 200
GET /proxmox/pve2/ext6/theme-crisp/resources/theme-crisp-all_2.css HTTP/1.1" 200
GET /proxmox/pve2/ext6/theme-crisp/resources/theme-crisp-all_1.css HTTP/1.1" 200
GET /pve2/images/proxmox_logo.png HTTP/1.1" 404
GET /proxmox/pve2/ext6/theme-crisp/resources/images/form/trigger.png HTTP/1.1" 200
[Warte auf Eingabe der Anmeldedaten]
GET /proxmox/pve2/ext6/theme-crisp/resources/images/loadmask/loading.gif HTTP/1.1" 200
POST /api2/extjs/access/ticket HTTP/1.1" 404
GET /proxmox/pve2/ext6/theme-crisp/resources/images/tools/tool-sprites.png HTTP/1.1" 200
GET /proxmox/pve2/ext6/theme-crisp/resources/images/shared/icon-error.png HTTP/1.1" 200
[Anmeldung gescheitert]

Setze ich zusätzlich:
ProxyPass / https://localhost:8006/
ProxyPassReverse / https://localhost:8006/
läuft die Anmeldung erfolgreich durch:
GET /proxmox/ HTTP/1.1" 200
GET /proxmox/pve2/ext6/crisp/resources/charts-all.css HTTP/1.1" 304
GET /proxmox/pve2/js/pmgmanagerlib.js HTTP/1.1" 304
GET /proxmox/pve2/ext6/ext-all.js HTTP/1.1" 304
GET /proxmox/pve2/css/ext6-pmg.css HTTP/1.1" 304
GET /proxmox/pve2/ext6/locale/locale-en.js HTTP/1.1" 304
GET /proxmox/fontawesome/css/font-awesome.css HTTP/1.1" 304
GET /proxmox/proxmoxlib.js HTTP/1.1" 304
GET /proxmox/pve2/ext6/theme-crisp/resources/theme-crisp-all.css HTTP/1.1" 304
GET /proxmox/pve2/ext6/charts.js HTTP/1.1" 304
GET /pve2/images/proxmox_logo.png HTTP/1.1" 200
GET /proxmox/pve2/ext6/theme-crisp/resources/images/form/trigger.png HTTP/1.1" 304
[Warte auf Eingabe der Anmeldedaten]
GET /proxmox/pve2/ext6/theme-crisp/resources/images/loadmask/loading.gif HTTP/1.1" 304
POST /api2/extjs/access/ticket HTTP/1.1" 200
GET /api2/extjs/version?_dc=1557492202126 HTTP/1.1" 200
GET /proxmox/fontawesome/fonts/fontawesome-webfont.woff2?v=4.7.0 HTTP/1.1" 200
GET /api2/extjs/nodes/localhost/subscription?_dc=1557492202508 HTTP/1.1" 200
GET /proxmox/pve2/ext6/theme-crisp/resources/images/tools/tool-sprites.png HTTP/1.1" 304
POST /api2/json/access/ticket HTTP/1.1" 200
GET /proxmox/pve2/ext6/theme-crisp/resources/images/shared/icon-warning.png HTTP/1.1" 200
GET /api2/json/config/cluster/status?list_single_node=1 HTTP/1.1" 200
GET /api2/json/statistics/recentreceivers?hours=12 HTTP/1.1" 200
[Anmeldung erfolgreich]

Das Problem ist nur, dass meine ursprüngliche Startlocation "/" damit nicht mehr erreicht wird und ich sofort zu Proxmox geleitet werde.

Ich habe es nicht geschafft, eine Konfiguration zu finden, die /api2/ auf /proxmox/api2/ bzw. /pve2/images/ auf /proxmox/pve2/images/ anhebt, um die Location "/" nicht mit Proxmox zu überschreiben.
 
Ich habe es geschafft!

Normalerweise sollten im Wesentlichen diese Zeilen
ProxyPass /proxmox/ https://localhost:8006/
ProxyPassReverse /proxmox/ https://localhost:8006/
ausreichen, aber mit diesen zusätzlichen Einträgen klappt es:
ProxyPass /api2/ https://localhost:8006/api2/
ProxyPass /pve2/images/ https://localhost:8006/images/

Ich halte es allerdings für einen "schmutzigen" hack, der eventuell auf einen bug in Ihrer Software hindeutet. Ich bin mir bewusst, dass mit dem nächsten Software-Release dieser hack nicht unbedingt mehr funktioniert und ich nach neuen Lösungen suchen muss :-(
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!