# 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;
charset utf-8;
client_max_body_size 200m;
# 超时设置
proxy_connect_timeout 600s;#设置连接超时时间
proxy_send_timeout 600s; #设置发送超时时间
proxy_read_timeout 600s;#设置读取超时时间
proxy_http_version 1.1;
# 请求头转发设置
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_set_header X-EOS-SourceSysKey dc6baaed30e541d78bb91274803d9432;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
# 安全响应头设置
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1";
add_header X-Frame-Options "SAMEORIGIN";
add_header Content-Security-Policy "script-src * 'unsafe-inline' 'unsafe-eval'";
add_header Strict-Transport-Security "max-age=SECONDS";
add_header X-Permitted-Cross-Domain-Policies "master-only";
add_header X-Download-Options noopen;
add_header Referrer-Policy "no-referrer" always;
location ~ /afc/api/public-resource/ {
rewrite ^/afc/api/(.*) /api/$1 break;
proxy_pass http://192.168.16.80:28083;
}
location ~ /(.*)/api/ {
proxy_pass http://eosgateway;
}
location ~ \.biz\.ext$ {
proxy_pass http://eosgateway;
}
location / {
root "/opt/dws/dws_ui";
index index.html index.htm;
try_files $uri /index.html;
}
}