nginx 配置websocket 支持wss

upstream websocket {  
    server xxx.xxx.xxx.xxx:xxxx;  
}  
server {  
    listen 80;  
    server_name xxx.xxx;
    ssl on;
    ssl_certificate /etc/nginx/ssl/hello.com_bundle.crt;
    ssl_certificate_key /etc/nginx/ssl/hello.com.key;
    ssl_session_timeout 20m;
    ssl_verify_client off;
    location /websocket {  
        proxy_pass http://websocket;  
        proxy_http_version 1.1;  
        proxy_set_header Upgrade $http_upgrade;  
        proxy_set_header Connection "Upgrade";  
    }  
}
nginx

websocket测试地址

websocket测试

打赏
  • 微信
  • 支付宝
评论
来发评论吧~
···

歌手: