美文网首页
nginx配置websocket反向代理(KubeSphere配

nginx配置websocket反向代理(KubeSphere配

作者: TinyThing | 来源:发表于2022-06-29 12:44 被阅读0次

示例配置

注意点:

  1. map里面的配置
  2. Connection 和 Upgrade
map $http_upgrade $connection_upgrade {
  default upgrade;
  '' close;
}
upstream kubesphere {
  server 192.168.0.88:30880;
  server 192.168.0.89:30880;
  server 192.168.0.90:30880;
  keepalive 300;
}


server {
    listen 80;
    server_name xxx.xxx.com;
    access_log /var/log/nginx/kubesphere_access.log;
    error_log /var/log/nginx/kubesphere_error.log;


    location / {
        proxy_pass http://kubesphere/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_set_header Host $host;
    }


    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

}

相关文章

网友评论

      本文标题:nginx配置websocket反向代理(KubeSphere配

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