http://blog.youkuaiyun.com/liulin_good/article/details/6213815

博客主要对集合架构进行讲解,涉及信息技术领域中集合架构相关知识,为读者提供集合架构方面的信息。
集合架构讲解
该配置中server { listen 40331; server_name 192.168.51.10; # 全局安全头 add_header X-Content-Type-Options "nosniff" always; add_header X-Frame-Options "SAMEORIGIN" always; server_tokens off; # 全局代理配置 proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 20m; # TCP优化 sendfile on; tcp_nopush on; keepalive_timeout 65s; # WebSocket ASR 路由 location ~ ^/(.*)/websocket/asr/(.*)$ { proxy_pass http://127.0.0.1:40330/$1/websocket/asr/$2$is_args$args; proxy_set_header Upgrade $http_upgrade; # 仅在此处设置 proxy_set_header Connection "upgrade"; # 使用明确值更安全 } # WebSocket路由 location = /webapi/websocket/regulatory/monitoring { proxy_pass http://127.0.0.1:40330/webapi/websocket/regulatory/monitoring; proxy_set_header Upgrade $http_upgrade; # 仅在此处设置 proxy_set_header Connection "upgrade"; # 使用明确值更安全 } # 流式接口 location /webapi/user/extractMinutes { proxy_pass http://127.0.0.1:40330; proxy_buffering off; proxy_cache off; chunked_transfer_encoding on; } # 通用API路由 location ~ ^/(webapi|peopleWx|orgApp|common) { proxy_pass http://127.0.0.1:40330; } # Druid监控 location /druid/ { proxy_pass http://127.0.0.1:40330/druid/; } gzip on; gzip_comp_level 6; # 压缩级别(1-9,越高CPU消耗越大) gzip_min_length 1024; # 仅压缩超过 1KB 的内容 gzip_types text/plain text/css application/json application/javascript application/xml image/svg+xml font/ttf; # 静态文件服务 location / { root /home/liulin/html/safe_manage/web/dist; index index.html; try_files $uri $uri/ /index.html; # 静态资源缓存配置(1年) location ~* \.(js|css|png|jpg|jpeg|gif|ico|woff2|svg)$ { expires 365d; add_header Cache-Control "public, immutable"; access_log off; } } # 特殊文件 location = /1231idxnEs.txt { root /etc/nginx/static; expires off; add_header Cache-Control "no-store"; } } 为什么只有当以下面这种写法时, location = /webapi/websocket/regulatory/monitoring { proxy_pass http://127.0.0.1:40330/webapi/websocket/regulatory/monitoring; proxy_set_header Upgrade $http_upgrade; # 仅在此处设置 proxy_set_header Connection “upgrade”; # 使用明确值更安全 } 才会生效,而以这种写法location /webapi/websocket/regulatory/monitoring { proxy_pass http://127.0.0.1:40330/webapi/websocket/regulatory/monitoring; proxy_set_header Upgrade $http_upgrade; # 仅在此处设置 proxy_set_header Connection “upgrade”; # 使用明确值更安全 }不会生效
03-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值