# Q1: 微应用部署,dws,公共资源-数据源访问sql客户端Websocket comection to 'ws://127.0.0.1:31199/afc/api/public-resource/sql-editor/异常问题
# A2: 在eos8.conf增加upgrade等属性,如下:
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
# Q2: 微应用部署,dws,当走网关gateway时,访问公共资源-数据源,查看sql客户端,数据库表中数据,报WebSocket connection to 'ws://127.0.0.1/afc/api/public-resource/sql-editor/:Unexpected response code: 404
# A2: 公共资源SQL客户端的请求通过nginx直接转到后端,不走gateway。在eos8.conf详细配置,如下:
upstream eosgateway {
server 127.0.0.1:9090;
}
#EOS afcenter by gateway
server {
listen 80;
client_max_body_size 200m;
location ^~ /afc/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-Port $remote_port;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:28083/;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
location ^~ /api/ {
proxy_set_header X-EOS-SourceSysKey dc6baaed30e541d78bb91274803d9432;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
# 2024-12-11
# 公共资源管理的请求跳过匹配
if ($request_uri !~* ^/afc/api/public-resource/sql-editor) {
proxy_pass http://eosgateway;
}
}
location ~ /(.*)/api/ {
proxy_set_header X-EOS-SourceSysKey dc6baaed30e541d78bb91274803d9432;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
# 2024-12-11
# 公共资源管理的请求跳过匹配
if ($request_uri !~* ^/afc/api/public-resource/sql-editor) {
proxy_pass http://eosgateway;
}
}
location ~ \.biz\.ext$ {
proxy_set_header X-EOS-SourceSysKey dc6baaed30e541d78bb91274803d9432;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://eosgateway;
}
location / {
root "/opt/primeton/web/afcenter";
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
index index.html index.htm;
try_files $uri /index.html;
}
}