alexta69 / metube

Self-hosted YouTube downloader (web UI for youtube-dl / yt-dlp)
GNU Affero General Public License v3.0
4k stars 263 forks source link

Unable to reverse proxy successfully #270

Closed topmask closed 1 year ago

topmask commented 1 year ago

configuration

docker-compose.yml

version: "3"
services:
  metube:
    image: ghcr.io/alexta69/metube
    container_name: metube
    restart: unless-stopped
    ports:
      - "127.0.0.1:9696:80"
    volumes:
      - /downloads/youtube:/downloads
    environment:
      UID: 106
      GID: 112

sudo docker ps -a

4b6d3b3c5d50   ghcr.io/alexta69/metube     "./docker-entrypoint…"   2 hours ago    Up 2 hours              8081/tcp, 127.0.0.1:9696->9696/tcp   metube

nginx

location / {
#        proxy_pass http://localhost:9696;
        proxy_pass http://127.0.0.1:9696;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade"; 
        proxy_set_header        X-Real-IP $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header        X-Forwarded-Proto $scheme;
        proxy_set_header Host $host;
        proxy_read_timeout      600s;
        proxy_send_timeout      600s;
}

}

Can't open the page 502 Bad Gateway

PikuZheng commented 1 year ago

Looks like a container network association issue, can you confirm that nginx can access another container via 127.0.0.1?

topmask commented 1 year ago

Looks like a container network association issue, can you confirm that nginx can access another container via 127.0.0.1?

Ok, I also installed Aria2

topmask commented 1 year ago
ports:
  - "127.0.0.1:9696:80"

ports:
  - "127.0.0.1:9696:8081"

The default port is 8081 problem solved