server { listen 443 ssl; server_name 域名; ssl_certificate "ssl证书路径.crt";#如"/etc/nginx/cert/a.crt" ssl_certificate_key "ssl证书路径.key";#如"/etc/nginx/cert/a.key" location /ws { proxy_pass http://127.0.0.1:监听端口; proxy_set_header Upgrade $http_upgrade;#重要,必须有 proxy_set_header Connection "Upgrade";#重要,必须有 } }
|