Skip to content

nginx proxy and websocket error #159

Description

@flower-wzh

我不得不创建这个issue,因为我翻看了已经关闭的issue,并没有能解决我的问题.
我描述下我的情况,我的clip服务是经过了nginx代理的,下面有贴我的配置.clip.local在etc/host中进行了映射.我处理好了nginx代理后的浏览器访问,功能正常.但是在我使用客户端来登录代理后的服务时出现了websocket的连接问题,在我的mac和windows都出现了这个情况,错误信息如下:
Login successful but websocket connection failed.
Please check websocket-url
Failed to connect websocket: Connection to ws://clip.local:8000/clipsocket timed out

I had to create this issue because I reviewed the closed issues and none of them addressed my concern
Let me describe my situation. My clip service is proxied through nginx, and I have attached my configuration below. clip.local is mapped in etc/hosts. I have successfully accessed the service through the nginx proxy in the browser, and the functionality is normal. However, when I use the client to log in to the proxied service, there is a websocket connection issue. This issue occurs on both my Mac and Windows, and the error message is as follows:
Login successful but websocket connection failed.
Please check websocket-url
Failed to connect websocket: Connection to ws://clip.local:8000/clipsocket timed out

Image
server {
    listen 8000;
    server_name clip.local;

    location / {
        proxy_pass http://127.0.0.1:23481;
        proxy_http_version 1.1;

        proxy_set_header Host $host:$server_port;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-Host $http_host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

    }
    location /clipsocket {
        proxy_pass http://127.0.0.1:23481/clipsocket;
        proxy_http_version 1.1;

        proxy_set_header Host $http_host;
        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 Origin $http_origin;

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

        proxy_connect_timeout 300;
        proxy_read_timeout 86400;
    }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions