I would like to change my local urls from 'localhost:port' to project related urls. Every other container in the stack (Node server etc.) works but only swagger container gives error 502 Bad Gateway.
I add this to my /etc/hosts file:
127.0.0.1 my-api-doc.local
here is my docker-compose.yml file:
version: '3'
services:
api_doc:
image: swaggerapi/swagger-ui
environment:
- "VIRTUAL_HOST=my-api-doc.local"
- "VIRTUAL_PORT=4000"
ports:
- "4000:8080"
links:
- nginx-proxy
nginx-proxy:
image: jwilder/nginx-proxy:alpine
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
restart: unless-stopped
Problem is, when i go to 'my-api-doc.local' in my browser, i receive '502 Bad Gateway' error. When i try 'localhost:4000', it works.