| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- # DRG系统 - 简化版 Nginx 配置(兼容 Nginx 1.14.2)
- # 适用于 Windows Server 2019
- worker_processes 1;
- events {
- worker_connections 1024;
- }
- http {
- include mime.types;
- default_type application/octet-stream;
-
- sendfile on;
- keepalive_timeout 65;
-
- # 如果 mime.types 不存在,取消下面的注释并手动定义类型
- # types {
- # text/html html htm shtml;
- # text/css css;
- # application/javascript js;
- # application/json json;
- # image/png png;
- # image/jpeg jpeg jpg;
- # image/gif gif;
- # image/svg+xml svg;
- # }
- server {
- listen 80;
- server_name localhost;
- # 前端静态文件根目录
- root html/dist;
- index index.html index.htm;
- # 启用 gzip 压缩(如果支持)
- # gzip on;
- # gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript application/javascript;
- # ========== 最重要的配置:API 代理 ==========
- location /iris-api/ {
- # 注意:旧版 Nginx 不支持 proxy_set_header 的某些用法
- proxy_pass http://172.16.2.15: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_buffering off;
-
- # 超时设置
- proxy_connect_timeout 60s;
- proxy_send_timeout 60s;
- proxy_read_timeout 60s;
- }
- # 处理 React Router - 所有请求都返回 index.html
- location / {
- try_files $uri $uri/ /index.html;
- }
- # 错误页面
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root html;
- }
- }
- }
|