Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] 添加socket.io端口 35000 的自定义 #18

Open
zuilintan opened this issue Sep 29, 2024 · 6 comments
Open

[Feature] 添加socket.io端口 35000 的自定义 #18

zuilintan opened this issue Sep 29, 2024 · 6 comments

Comments

@zuilintan
Copy link

No description provided.

@zuilintan
Copy link
Author

如entrypoint.sh 30080 处理方式

@tsosunchia
Copy link
Member

没懂这样做的目的是啥,本仓库提供修改nginx暴露端口的办法了呀

@tsosunchia
Copy link
Member

nginx暴露的就是反代socket.io过后的

@zuilintan
Copy link
Author

是这样的,
首先,/socket.io需要在宿主的nginx中再次反代,并指定35000,
否则无法正常在外网进行路由追踪。

而35000这个端口,有其它程序将占用,冲突。

所以,建议也为其追加其自定义。

@zuilintan
Copy link
Author

我原打算通过bridge方式部署,
对35000映射,
可惜如此却也无法正常路由追踪了

@loveqianool
Copy link

我添加环境变量 TEST_HOST=0.0.0.0 后,可以在外部 nginx 反代,用倒是能用了,但是 wss 一直连不上,有报错 。
nexttraceweb | 2024-12-05 13:51:08,177 ERROR https://nexttraceweb.examples.com is not an accepted origin. (further occurrences of this error will be logged with level INFO)

compose.yaml

version: "3.3"
services:
  nexttraceweb:
    stdin_open: true
    tty: true
    container_name: nexttraceweb
    hostname: nexttraceweb
    restart: unless-stopped
    environment:
      - TZ=${TZ}
      - TEST_HOST=0.0.0.0
      - TEST_PORT=35000
    cap_add:
      - NET_ADMIN
    ports:
      - 35000:35000
    image: tsosc/nexttraceweb

nginx.conf

server {
    listen 8888;
    listen [::]:8888;

    server_name nexttraceweb.examples.com;

    return 301 https://$server_name$request_uri;
}
server {
    server_name nexttraceweb.examples.com;

    include config/examples.com;

    location / {
        proxy_pass http://10.0.1.128:35000;
        proxy_http_version 1.1;
        proxy_cache_bypass $http_upgrade;

        # Proxy SSL
        proxy_ssl_server_name on;

        # Proxy headers
        proxy_set_header Host $host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Forwarded $proxy_add_forwarded;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Port $server_port;

        # Proxy timeouts
        proxy_connect_timeout 60s;
        proxy_send_timeout 60s;
        proxy_read_timeout 60s;
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants