wikihost-opensource / als

Another Looking-glass Server
MIT License
1.18k stars 144 forks source link

[BUG] Docker部署-通过Caddy反代打不开 #60

Closed toyo2333 closed 10 months ago

toyo2333 commented 10 months ago

如果直接用你提供的docker启动命令正常,通过VPSip+80端口可以访问

docker run -d --name looking-glass --restart always --network host wikihostinc/looking-glass-server

但我这里是通过反代进行的,就打不开,页面是白的 docker compose里是这样

    als:
        image: wikihostinc/looking-glass-server
        networks:
            - my_network
        container_name: als
        restart: always

    caddy:
        image: caddy:latest
        networks:
            my_network:
                ipv4_address: 172.19.0.5
        container_name: caddy
        hostname: caddy
        restart: unless-stopped
        logging:
            options:
                max-size: 10m
        volumes:
            - ./caddy/Caddyfile:/etc/caddy/Caddyfile
            #- ./site:/srv
            - caddy_data:/data
            - caddy_config:/config
volumes:
    caddy_data:
    caddy_config:

networks:
  my_network:
    ipam:
      driver: default
      config:
        - subnet: 172.19.0.0/16 

caddy也是docker compose部署,和als在同一个network下面

Caddyfile如下

mydomian.com {
    handle {
        reverse_proxy contain1:80
    }

    handle_path /contain2/* {
        reverse_proxy contain2:xxxx
    }

    handle_path /contain2/* {
        reverse_proxy contain3:xxx
    }

    handle_path /als/* {
        reverse_proxy als:80
    }

    encode gzip
    log {
        format console
    }
}
samlm0 commented 10 months ago

v2.0-fix1 中已修复该问题

测试的 Nginx 配置如下,Caddy 需要按需修改

    location /als/ {
        proxy_http_version 1.1;
        proxy_set_header Connection "";
        proxy_buffering off;
        proxy_cache off;
        proxy_pass http://127.0.0.1:10001/;
    }
charliez0 commented 8 months ago

websocket地址在哪儿啊👀