|
|
|
@ -1,14 +1,18 @@
|
|
|
|
|
# 定义web服务地址
|
|
|
|
|
upstream virtual-patient-web{
|
|
|
|
|
server 192.168.10.138:8799;
|
|
|
|
|
}
|
|
|
|
|
# 前台服务后端地址,多个地址可用与负载均衡
|
|
|
|
|
upstream web_servers {
|
|
|
|
|
server 192.168.10.138:8899;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#后管服务后端地址
|
|
|
|
|
upstream manage_servers {
|
|
|
|
|
server 192.168.10.138:8891;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
server {
|
|
|
|
|
listen 80;
|
|
|
|
|
listen [::]:80;
|
|
|
|
|
server_name localhost;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#access_log /var/log/nginx/host.access.log main;
|
|
|
|
|
client_max_body_size 20M; # 设置客户端请求的最大上传大小为 20MB,可以根据实际情况修改
|
|
|
|
|
|
|
|
|
@ -21,20 +25,47 @@ server {
|
|
|
|
|
index rasa.html rasa.htm;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
|
|
|
location = /50x.html {
|
|
|
|
|
root /usr/share/nginx/html/dist;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# 前台后端服务
|
|
|
|
|
location /virtual-patient/ {
|
|
|
|
|
proxy_pass http://virtual-patient-web/virtual-patient/;
|
|
|
|
|
proxy_pass http://web_servers/virtual-patient/;
|
|
|
|
|
proxy_set_header Host $http_host;
|
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
|
}
|
|
|
|
|
#error_page 404 /404.html;
|
|
|
|
|
|
|
|
|
|
# redirect server error pages to the static page /50x.html
|
|
|
|
|
#
|
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
|
|
|
location = /50x.html {
|
|
|
|
|
root /usr/share/nginx/html/dist;
|
|
|
|
|
# 前台文件服务代理到后管
|
|
|
|
|
location /virtual-patient/fileManage/ {
|
|
|
|
|
proxy_pass http://manage_servers/virtual-patient-manage/fileManage/;
|
|
|
|
|
proxy_set_header Host $http_host;
|
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# websocket 代理服务
|
|
|
|
|
location /virtual-patient-websocket/ {
|
|
|
|
|
proxy_pass http://web_servers/virtual-patient/;
|
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
|
proxy_set_header Connection "Upgrade";
|
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# 后管后端服务
|
|
|
|
|
location /virtual-patient-manage/ {
|
|
|
|
|
proxy_pass http://manage_servers/virtual-patient-manage/;
|
|
|
|
|
proxy_set_header Host $http_host;
|
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|