curl -i -N -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Host: XXXXXXX" -H "Origin: https://XXXXXXX/" -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' https://XXXXXXX/
HTTP/2 405
server: nginx/1.18.0
date: Fri, 26 Feb 2021 13:56:20 GMT
content-type: text/plain; charset=utf-8
content-length: 19
sec-websocket-version: 13
x-content-type-options: nosniff
Method Not Allowed
geth is running with websockets enabled with the following settings: --ws --ws.port 8546 --ws.api eth,net,web3 --ws.origins '*' --ws.addr 0.0.0.0
and is behind an nginx reverse proxy:
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade "websocket"; # $http_upgrade;
proxy_set_header Connection "upgrade"; # $connection_upgrade;
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_pass http://XXXXXX;
}
I have also tried eth version command, same result. Same error when I connect to the websocket directly, not through nginx.