Docker reverse proxy ping work while app service not

Viewed 94

docker-compose.yml

version: '2'

services:
  whoami:
    image: jwilder/whoami
    container_name: whoami
    networks:
      - no-internet

  proxy:
    image: nginx:1.13-alpine 
    container_name: proxy
    networks:
      - no-internet
    volumes:
      - ./vhost.conf:/etc/nginx/conf.d/default.conf
    ports:
      - "8091:80"
    depends_on:
      - whoami

networks:
  no-internet:
    external: true
    name: no-internet
server {
    server_name localhost;
    listen 80;
    location / {
        proxy_pass http://whoami:8000;
    }
}

result: enter image description here enter image description here

I attach proxy container and execute two commands, which result that ping whoami worked while nc to whoami:8000 or wget http://whoami:8000 not working

enter image description here enter image description here

I check the service of whoami as well, this shows that the http service is working properly enter image description here

0 Answers
Related