client request is
let protocol = location.protocol === "https:"
? "wss://www.domain.com:8180"
: "ws://www.domain.com:8180";
var ws = new WebSocket(protocol);
nginx is configured as follows:
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name www.aizhaohui.com; -sharp
ssl on;
root /var/www/html; -sharp
index index.html index.htm index.nginx-debian.html; -sharp index.html
ssl_certificate cert/1_www.aizhaohui.com_bundle.crt; -sharp
ssl_certificate_key cert/2_www.aizhaohui.com.key; -sharp
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
-sharpvue404
location / {
try_files $uri $uri/ @router;
index index.html;
}
location @router {
rewrite ^.*$ /index.html last;
}
location /wss { -sharp 1websocket
proxy_pass http://wscp;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
}
upstream wscp{
server 116.62.220.89:8180;
}
the current problem is to call and report an error: