kyubotics/coolq-http-api

Cannot Login behind NGINX Reverse Proxy

HsuJv opened this issue · 2 comments

HsuJv commented

It shows "Failed to connect to server"
image

With log:

cqhttp_1  | 127.0.0.1 - - [11/May/2020 14:13:46] code 405, message Method Not Allowed
cqhttp_1  | 172.18.0.1 - - [11/May/2020:06:13:46 +0000] "GET /websockify HTTP/1.0" 405 216 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36"

Nginx config:

server {
    listen 8080;
    listen [::]:8080;
    server_name SomethingSensitive;
    location / {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_pass http://127.0.0.1:9000;
    }
}

Is there anything more to do?

Thanks in advance
BRs.

Using NGINX as a WebSocket Proxy
location /websockify {
           proxy_http_version 1.1;
           proxy_set_header Upgrade $http_upgrade;
           proxy_set_header Connection "upgrade";
           proxy_pass http://127.0.0.1:9000;
}
HsuJv commented

Good!!! it works.

Thanks again.

Close it