OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • International Forums »
  • German - Deutsch (Moderator: JeGr) »
  • HAProxy url rewrite und websockets (Guacamole)
« previous next »
  • Print
Pages: [1]

Author Topic: HAProxy url rewrite und websockets (Guacamole)  (Read 4977 times)

badzoo

  • Newbie
  • *
  • Posts: 12
  • Karma: 0
    • View Profile
HAProxy url rewrite und websockets (Guacamole)
« on: March 12, 2018, 03:16:34 pm »
Hallo,

ich habe 2 Fragen, die ich bisher hier nicht mit den Antworten aus dem Forum lösen konnte:

1. Wie kann ich einen Rewrite der URL von http://firewall/guacamole nach http://backend:8080/guacamole vornehmen ?
Soweit ich das verstanden habe, müsste ich bei den Backend Einstellungen in der Optionsweiterleitung (Custom Option) etwa sowas angeben:

Code: [Select]
reqrep ^([^\ ]*)\ /guacamole/(.*) \1\ /\2.

Der Backend Server ist auf Port 8080 eingerichtet. Das Rewrite scheint aber nicht zu klappen ??

2. Wie kann ich die WebSocket mit einschließen ??
   
Gucamole Proxy:
https://guacamole.apache.org/doc/gug/proxying-guacamole.html
   
3 Ways to proxy Websockets:
http://blog.silverbucket.net/post/31927044856/3-ways-to-configure-haproxy-for-websockets

Beispiel für Rewrite mit HAProxy:
https://www.haproxy.com/blog/howto-write-apache-proxypass-rules-in-haproxy/

Leider habe ich beides bisher nicht hinbekommen.. Bitte um eure Hilfe !

Gruß
Badzoo
 
Logged

mimugmail

  • Hero Member
  • *****
  • Posts: 6292
  • Karma: 432
    • View Profile
Re: HAProxy url rewrite und websockets (Guacamole)
« Reply #1 on: March 12, 2018, 03:36:45 pm »
Musst du zu 1) nicht einfach bei Real Server den Port auf 8080 stellen?
Logged
Twitter: mimu_muc
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

badzoo

  • Newbie
  • *
  • Posts: 12
  • Karma: 0
    • View Profile
Re: HAProxy url rewrite und websockets (Guacamole)
« Reply #2 on: March 12, 2018, 03:39:10 pm »
Hi,

ich habe den Real Server auf 8080 laufen.. jedoch klappt der Zugriff noch nicht.

ich bekomme immer 404 Not found, wenn ich http://firewall/guacamole aufrufe. der interne Aufruf (im Nat Netz) über http://backend:8080/guacamole funktioniert einwandfrei. In Firewall konnte ich nichts dazu entdecken.
« Last Edit: March 12, 2018, 03:44:34 pm by badzoo »
Logged

JeGr

  • Moderator
  • Hero Member
  • *****
  • Posts: 1825
  • Karma: 208
  • old man standing
    • View Profile
Re: HAProxy url rewrite und websockets (Guacamole)
« Reply #3 on: March 12, 2018, 04:20:15 pm »
Und von wo testest du? Vom WAN oder vom LAN aus? HAProxy wird ja sehr wahrscheinlich die URL auf der WAN Seite annehmen und ins LAN übergeben sollen?
Logged
"It doesn't work!" is no valid error description! - Don't forget to [applaud] those offering time & brainpower to help you!
Better have some *sense as no(n)sense! ;)

If you're interested in german-speaking business support, feel free to reach out via PM.

badzoo

  • Newbie
  • *
  • Posts: 12
  • Karma: 0
    • View Profile
Re: HAProxy url rewrite und websockets (Guacamole)
« Reply #4 on: March 12, 2018, 04:37:17 pm »
Ich habe zwei Test gemacht:

Vom LAN aus den Aufruf aufs http://backend:8080/guacamole - hier funktioniert alles tadellos
Vom Wan aus den Aufruf auf http://firewall/guacamole  - Fehler 404 Not found.

Logged

mimugmail

  • Hero Member
  • *****
  • Posts: 6292
  • Karma: 432
    • View Profile
Re: HAProxy url rewrite und websockets (Guacamole)
« Reply #5 on: March 12, 2018, 04:52:01 pm »
Was sagt das HA log und kommen Pakete bei Guacamole an?
Logged
Twitter: mimu_muc
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

badzoo

  • Newbie
  • *
  • Posts: 12
  • Karma: 0
    • View Profile
Re: HAProxy url rewrite und websockets (Guacamole)
« Reply #6 on: March 12, 2018, 05:12:30 pm »
Hi,

ich habe gerade noch im HA Log nachgeschaut..

Die Verbindung zur Hauptseite (/) funktioniert:
haproxy[65526]: Connect from XXX.XXX.XXX.XXX:50417 to xxx.xxx.xxx.xx:443 (Main_Frontend/HTTP)

Auf dem BackendServer läuft auf Port 80 eine Webgui und auf Port 8080 Guacamole. Für jeden Port habe ich einen RealServer eingerichtet.

Das zweite Backend für Guacamole (Guacamole_Frontend/HTTP) hat keinen Eintrag. Dort scheint die Verbindung nicht zu klappen.Blockiert hier die Firewall ?  ??? Kein Eintrag gefunden.

Die zugehörige Condition für Guacamole lautet : "Path starts with" Path prefix  "/guacamole*"
Die zugehörige Rule für Guacamole lautet: use specific Backend  -> Guacamole_Backend   (welche auf Port 8080 läuft)

Das ziel ist also:

Aufruf über https://firewall -> Main_Backend  /
Aufruf über https://firewall/guacamole -> Guacamole_Backend  /

Für einen Test habe ich in der Firewall für die WAN Schnittstelle Port 8080 freigegeben.. Danach klappt der Aufruf von Guacamole über http://firewall:8080/guacamole.. Nur nicht direkt ohne Port 8080
« Last Edit: March 12, 2018, 05:23:10 pm by badzoo »
Logged

fabian

  • Hero Member
  • *****
  • Posts: 2768
  • Karma: 199
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: HAProxy url rewrite und websockets (Guacamole)
« Reply #7 on: March 12, 2018, 05:22:37 pm »
Quote from: badzoo on March 12, 2018, 03:16:34 pm
Die zugehörige Condition für Guacamole lautet : "Path starts with" Path prefix  "/guacamole*"
Die zugehörige Rule für Guacamole lautet: use specific Backend  -> Guacamole_Backend   (welche auf Port 8080 läuft)

Mach mal den Asterisk weg.
Logged

badzoo

  • Newbie
  • *
  • Posts: 12
  • Karma: 0
    • View Profile
Re: HAProxy url rewrite und websockets (Guacamole)
« Reply #8 on: March 12, 2018, 05:27:59 pm »
Ohne Asteriks funktioniert jetzt der Zugriff !! Damit ist Problem 1 gelöst ...

Vielen Dank dafür.. Manachmal kann es so einfach sein..

Hast du auch noch eine Idee zu den Websockets ?
Es funktionert zwar auch so, aber das wäre für die Performance besser, wenn man die Einbinden könnte.
Logged

fabian

  • Hero Member
  • *****
  • Posts: 2768
  • Karma: 199
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: HAProxy url rewrite und websockets (Guacamole)
« Reply #9 on: March 12, 2018, 05:44:43 pm »
Kann ich von hier aus nicht sagen aber ich würde mal im Browser schauen, ob der Upgrade-Request funktioniert, da Websockets als normaler HTTP-Request beginnen. Vielleicht geht da was schief.
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • International Forums »
  • German - Deutsch (Moderator: JeGr) »
  • HAProxy url rewrite und websockets (Guacamole)
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2023 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2