美文网首页
Ngnix 配置websocket

Ngnix 配置websocket

作者: 莫名点 | 来源:发表于2020-10-16 09:28 被阅读0次
    http {
        # websocket http中配置添加
        map $http_upgrade $connection_upgrade {
                default upgrade;
                '' close;
        }
        server {
            location /server/ {        
                # websocket server 中配置添加
                        proxy_http_version 1.1;
                            proxy_connect_timeout 60s;              
                            proxy_read_timeout 600s;                
                        proxy_send_timeout 12s; 
                        proxy_set_header Upgrade $http_upgrade;
                            proxy_set_header Connection "upgrade";     
                 }  
        }
    }
    

    相关文章

      网友评论

          本文标题:Ngnix 配置websocket

          本文链接:https://www.haomeiwen.com/subject/xezapktx.html