0

So basically I have 2 different applications running on port 5000 and 30000 on a single ubuntu server respectively.Both these application has to be mapped using haproxy.I am using acl path_beg to use a made up pathname(alias) to access these applications instead of using their respective port numbers.

what i have tried so far

frontend http-in
    mode    http

    bind *:80
    bind *:443 ssl crt /etc/ssl/private/mydomain.pem
    http-request redirect scheme https code 301 if !{ ssl_fc }

    acl path-employeeList              path_beg -i /ProcessDesigner
    use_backend backend1               if path-employeeList

    acl path-employeeListfinal            path_beg -i /ProcessCore
    use_backend backend2               if path-employeeListfinal

backend backend1
    mode    http

    option  httplog
    option  forwardfor
    reqrep  ^([^\ :]+)\ /ProcessDesigner/?(.*)$  \1\ /\2

    server  backend1  206.189.22.155:30000


backend backend2
    mode    http

    option  httplog
    option  forwardfor
    reqrep  ^([^\ :]+)\ /ProcessCore/?(.*)$  \1\ /\2

    server  backend2 206.189.22.155:5000

Using this configuration i am only able to access the first application at https://206.189.22.155/ProcessDesigner, but when i try to access the second application at https://206.189.22.155/ProcessCore i get a white blank page with no output.Inspecting the page and checking the console shows me "Failed to load resource:the server responded with a status of 503(service unavailable)".

1

1 Answer 1

0

I think You shouldnt open a new question. So see haproxy redirection not working using pathname? and first remove these lines:

    acl path-employeeListnew              path_beg -i /
    use_backend backend1               if path-employeeListnew
17
  • ok i removed those lines....the 1st app is reachable at 206.189.22.155/ProcessDesigner but the 2nd app at 206.189.22.155/ProcessCore is just showing a black white page with no output. Oct 8, 2019 at 18:03
  • i inspected the page in chrome browser and in the console it says "Failed to load resource:the server responded with a status of 503(service unavailable). Oct 8, 2019 at 18:06
  • ie, backend1 works but backend2 doesnt Oct 8, 2019 at 18:08
  • ok You need first to fix backend 1 - if you have that working properly its time to check backend 2. so You must get backend1 working without the path-employeeListnew. (possibly it's unavoidable to re-add soemtghing similiar but that is a last resort option then). So if You remove these ACLs, what do You get for App1? Or is it working then? (If App1 is working wothout the amployeeListNew stuff then check ProcessCore in dev console / network-analysis tab and tell the details of the ressources that are failing like wich path requested in that case from server or what)
    – EOhm
    Oct 8, 2019 at 18:22
  • If i remove the acl path-employeeListnew then 206.189.22.155/ProcessDesigner is loading (works!) but 206.189.22.155/ProcessCore is not loading. Oct 8, 2019 at 18:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .