Quantcast
Viewing all articles
Browse latest Browse all 4731

Haproxy - Routing failing with nodejs app

Hi everyone,

I was following this guide, unfortunately I’m facing to the following issue :

  1. When I try to reach “mydomain.example/myapp”, I’m getting “Cannot GET /myapp”

  2. As a test, I created 2 containers Apache and Nginx, and it was working fine (I tested with /nginx and /apache)

  3. When I check haproxy report, I can see “myapp” “Active UP” with the correct IP (from the overlay network) on port 49000.

Here is my haproxy.cfg file: https://pastebin.com/jDmbSqN6

Docker commands :
Network:
sudo docker network create --attachable --driver overlay apache-network

Services:
mydomain.example/

sudo docker service create
–mode replicated
–replicas 1
–name home-Service
–network apache-network
–endpoint-mode dnsrr
httpd:2.4

mydomain.example/myapp
sudo docker service create
–mode replicated
–replicas 1
–name myapp-Service
–network apache-network
–endpoint-mode dnsrr
somewhere/myapp:1.0

myapp is container with a NodeJS server that host a small webapp
If I remove HAProxy, and I recreate the service “myapp” and replace “endpoint-mode” by the publishing port (-p 49000: 49000), myapp works fine.

Any suggestions on how I can troubleshoot or resolve this issue ? :-/

Thanks in advance!

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 4731

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>