d2iq-archive/marathon-lb

2 apps 1 marathon-lb

Opened this issue · 0 comments

I am trying to set two different vhosts to connect to two different applications in the same marathon-lb one of them tries to point app2.internal to a pool of scrappinghub/splash containers and the other one tries to point app1.internal to a container running php-apache.

the problem is when it's called sometimes I request app1 and get the app2 content and other times is the other way around

config for app1.internal

"portMappings": [
      {
        "containerPort": 80,
        "hostPort": 0, 
        "servicePort": 80,
        "protocol": "tcp",
        "name": "http",
        "labels": null
      }

  "networks": [
    {
      "mode": "container/bridge"
    }
  ],
  "labels": {
    "HAPROXY_GROUP":"external",
    "HAPROXY_0_VHOST":"app1.internal"
  }

config for app2.internal

 "portMappings": [
      {
        "containerPort": 8050,
        "hostPort": 0, 
        "servicePort": 80,
        "protocol": "tcp",
        "name": "http",
        "labels": null
      },
      {
        "containerPort": 5023,
        "hostPort": 0, 
        "protocol": "tcp",
        "name": "telnet",
        "labels": null
      }
    ],
    "volumes": []
  },
  "networks": [
    {
      "mode": "container/bridge"
    }
  ],
  "labels": {
    "HAPROXY_GROUP":"external",
    "HAPROXY_0_VHOST":"app2.internal",
    "HAPROXY_0_BACKEND_HEAD":"backend {backend}\n  balance {balance}\n  mode {mode}\n  timeout server 30m\n  timeout client 30m\n"
  },

and marathon-lb is started with
docker run --name marathon-lb -dit --restart=always -e PORTS=9090 -p 80:80 -p 443:443 -p 9090:9090 --net=host -v /etc/hosts:/etc/hosts mesosphere/marathon-lb sse --group external --marathon http://10.4.0.116:8080 --skip-validation --haproxy-map