rokevin
移动
前端
语言
  • 基础

    • Linux
    • 实施
    • 版本构建
  • 应用

    • WEB服务器
    • 数据库
  • 资讯

    • 工具
    • 部署
开放平台
产品设计
  • 人工智能
  • 云计算
计算机
其它
GitHub
移动
前端
语言
  • 基础

    • Linux
    • 实施
    • 版本构建
  • 应用

    • WEB服务器
    • 数据库
  • 资讯

    • 工具
    • 部署
开放平台
产品设计
  • 人工智能
  • 云计算
计算机
其它
GitHub
  • nginx支持WebScoket

nginx支持WebScoket


http {

    map $http_upgrade $connection_upgrade {
        default upgrade;
        '' close;
    }
}

server {
    
    server_name czdev.rokevin.cn;
    listen 80;
    access_log off;
    client_max_body_size 10M;

    # 支持https
    listen 443;
    ssl on;
    ssl_certificate "/fish/cert/https/1_czdev.rokevin.cn_bundle.crt";
    ssl_certificate_key "/fish/cert/https/2_czdev.rokevin.cn.key";
    ssl_session_cache shared:SSL:1m;
    ssl_session_timeout  10m;
    ssl_ciphers HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers on;

    location / {
            root /fish/project-web/bl-admin-station/target;
    }

    location /station_web {
            proxy_pass http://bldev;
            access_log /var/log/nginx/czdev.rokevin.cn.access.log post_format;
    }
    
    # 支持websocket
    location /gate {

            # 支持websocket
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            #proxy_set_header "upgrade"; #此配置和下面的配置都可以
            proxy_set_header Connection $connection_upgrade;
            proxy_set_header Origin "http://bldev";
            
            proxy_pass http://bldev;
            access_log /var/log/nginx/czdev.rokevin.cn.access.log post_format;
    }
}
最近更新:: 2020/7/25 22:02
Contributors: luokaiwen