| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- # DRG医保控费预警系统 - Nginx 配置(生产真实配置,2026-09-12 同步)
- # 适用于 Windows Server 2019
- # 前端对外端口 8082;8081 反代本机 80 端口(承载其它业务系统)
- worker_processes 1;
- events {
- worker_connections 1024;
- }
- http {
- include mime.types;
- default_type application/octet-stream;
- sendfile on;
- keepalive_timeout 65;
- # 前端应用服务器
- server {
- listen 8082;
- server_name localhost;
- # 前端静态文件根目录
- root E:\DRG\dist;
- index index.html index.htm;
- # 启用 gzip 压缩
- gzip on;
- gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
- # API 代理 - 使用精确匹配
- # 超时说明:HIS 数据同步(02010067)在大数据量下单次调用可能耗时数分钟,
- # nginx 默认 proxy_read_timeout(60s) 会提前断开返回 504,
- # 故放宽到 600s,与 src.External.Service 中 httprequest.Timeout = 600 对齐。
- # 注意:IRIS 侧 Web Gateway(52773)的 Server Response Timeout 默认 300s,需同步调大,否则仍会断。
- location = /iris-api/invoke {
- proxy_pass http://127.0.0.1:52773/csp/drg/sysInternalMutiple;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_read_timeout 600s;
- }
- # API 代理 - 使用精确匹配(带 /dipapp 前缀,与前端 request.ts baseURL = '/dipapp/iris-api' 一致)
- # 该 location 必须存在,否则请求会落到 location / 被 try_files 当静态文件处理,返回 405
- location = /dipapp/iris-api/invoke {
- proxy_pass http://127.0.0.1:52773/csp/drg/sysInternalMutiple;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_read_timeout 600s;
- }
- # 处理 React Router - 所有请求都返回 index.html
- location / {
- try_files $uri $uri/ /index.html;
- }
- # 静态资源缓存
- location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
- expires 1y;
- add_header Cache-Control "public, immutable";
- }
- # 错误页面
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root html;
- }
- }
- # 反代本机 80 端口(其它业务系统占用 80,经此端口对外)
- server {
- listen 8081;
- server_name localhost;
- location / {
- proxy_set_header Connection keep-alive;
- proxy_pass http://127.0.0.1/;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_connect_timeout 20;
- proxy_send_timeout 90;
- proxy_read_timeout 600s;
- proxy_buffering off;
- keepalive_timeout 65;
- keepalive_requests 500;
- proxy_http_version 1.1;
- client_max_body_size 10m;
- }
- }
- }
|