From abe1f6397e39b6a11484e707beb88f894cb5b2ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Fri, 3 Nov 2023 18:40:25 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20nginx=20=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=94=AF=E6=8C=81=20websocket?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/nacos/ruoyi-resource.yml | 1 + docker/nginx/conf/nginx.conf | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/config/nacos/ruoyi-resource.yml b/config/nacos/ruoyi-resource.yml index 004b43c6..dbabf089 100644 --- a/config/nacos/ruoyi-resource.yml +++ b/config/nacos/ruoyi-resource.yml @@ -27,6 +27,7 @@ spring: # password: ${datasource.system-postgres.password} websocket: + # 如果关闭 需要和前端开关一起关闭 enabled: true # 路径 path: /websocket diff --git a/docker/nginx/conf/nginx.conf b/docker/nginx/conf/nginx.conf index f926a1b1..176bc05e 100644 --- a/docker/nginx/conf/nginx.conf +++ b/docker/nginx/conf/nginx.conf @@ -71,6 +71,10 @@ http { proxy_set_header X-Real-IP $remote_addr; proxy_set_header REMOTE-HOST $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # websocket参数 + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; proxy_pass http://server/; }