Multi port cantainers with nginx-proxy

Viewed 1180

I'm currently running a container with my web application and it communicates through two ports, for the frontend and backend. I'm using jwilder/nginx-proxy to serve the applictions. When I run the docker compose file (which starts the app and the proxy) it gives me a 502 Bad gateway when I run with only one port it serves that part of the app. Im passing the port with the "VIRTUAL_PORT=80" is there a way to pass more than one port or if I make a separate container for the Frontend how would I get the proxy to speak to both containers with one request? In short does jwilder/nginx-proxy support multiport containers, and if not what's the workaround? Thank in advance!

Docker-compose.yml

reverseproxy:  
  image: jwilder/nginx-proxy

  ports:
      - "80:80"
      - "8080:8080"
  volumes:
      - /var/run/docker.sock:/tmp/docker.sock

myapp:
  depends_on:
    - reverseproxy
  build: ./app-files
  environment:
     - "VIRTUAL_HOST=my-domain.com"
     - "VIRTUAL_PORT=80,8080"
  expose:
     - 80
     - 8080
0 Answers
Related