lejianwen / rustdesk-api

Custom Rustdesk Api Server, include web admin ,web client and oidc login
196 stars 53 forks source link

反代后Web Client无法正常使用 #11

Closed syscc closed 4 weeks ago

syscc commented 4 weeks ago

Web Client不支持反代后 https连接

lejianwen commented 4 weeks ago

使用HTTPS的话,21118,21119需要走wss

server {
    server_name <your server>;
    listen 21118 ssl; 
    ssl_certificate <your cert>;
    ssl_certificate_key <your key>;

    location / {
        proxy_pass http://localhost:21108;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_set_header Host $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;
    }
}
server {
    server_name <your server>;
    listen 21119 ssl; 
    ssl_certificate <your cert>;
    ssl_certificate_key <your key>;

    location / {
        proxy_pass http://localhost:21109;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_set_header Host $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;
    }
}

然后你server的2111821119分别改成 21108 21109即可

syscc commented 4 weeks ago

明白了感谢