HAproxy Verständnisfrage



  • Hallo,

    ich habe verschiede Subdomains über HAproxy auf verschiedene Server im LAN gelegt. Das funktioniert (Dank Hilfe von hier!) auch soweit.

    Jetzt versuche ich, einen Webserver der im LAN über Port 8083 erreichbar ist, von aussen über eine Subdomain erreichbar zu machen.
    In der Backendeinstellung von HAproxy kann ich die gewünschte IP-Adresse aus dem LAN (192.168.xxx.xxx) und den Port (hier also 8083) eingeben - allerdings funktioniert das nicht. Vermutlich ein Denkfehler? Aber wo?
    (und wie macht man das dann?)

    Danke
    bakunin



  • Hi bakunin,

    Sorry for english response..

    But what does not function?
    Is the backend server 'green' in the stats page?
    Or are perhaps page links returned to the client containing the wrong port?

    Backends on a non-standard port by itself should not be a problem, but the web application might make it difficult depending what kind of links/redirects it returns..

    Regards,
    PiBa-NL



  • Hi PiBa,

    yep - the backend-Server is red (DOWN) in the stats page.
    If I try to connect to the server from the Internet (via http) i get:
    "503 Service Unavailable
    No server is available to handle this request. "
    From inside the LAN the server works fine!

    Genau - in der Statusübersicht wird der Host als "DOWN" (rot) angezeigt und ich bekomme
    "503 Service Unavailable
    No server is available to handle this request. "
    wenn ich versuche aus dem Internet über http darauf zuzugreifen.
    Vom LAN aus antwortet der Server mit der normalen Webseite.

    THX
    bakunin



  • Hi bakunin,

    Ok the 503 is by design if no server is 'up'.
    As for the 'down' status while it is actually working properly try changing a few options of the healthcheck.

    • Fill in the "Http check version" with at least a http version and the 'host' header like in the example
    HTTP/1.1\r\nHost:\ www
    
    • If that doesnt help change the "Http check method" to 'GET' instead of the default 'OPTIONS' method.

    If that works you could try a few other options mentioned, perhaps 'HEAD' works to? Goal would be to minimize load and log spamming in the backend webapplication. OPTIONS method usually does not log much or is easy to filter out.

    Also if you 'hover' the mouse over the healthcheck status on the stats page, it should tell you why its marked down. Can you tell what it says there?

    Regards
    PiBa-NL



  • @PiBa:

    • If that doesnt help change the "Http check method" to 'GET' instead of the default 'OPTIONS' method.

    That did the job. Now it works.

    THX

    bakunin


Log in to reply