| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- # nginx.conf
- worker_processes 5;
- events {
- worker_connections 1024;
- }
- http {
- include mime.types;
- default_type application/octet-stream;
- client_max_body_size 200m;
- sendfile on;
- keepalive_timeout 65;
- server {
- listen 80; # 容器内端口
- server_name localhost;
- # 前端静态资源目录(对应容器内的 /usr/share/nginx/html)
- root /usr/share/nginx/html;
- index index.html;
- # 关键:处理 VUE Router history 模式(避免刷新 404)
- location / {
- try_files $uri $uri/ /index.html; # 所有路由指向 index.html
- }
- # 反向代理 - fs-company(8006) 租户服务端API
- # 以下路径前缀只有fs-company有Controller,需代理到8006
- location /prod-api/adv/ {
- proxy_pass http://192.168.58.159:8006/adv/;
- 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_set_header X-Forwarded-Proto $scheme;
- }
- location /prod-api/aicall/ {
- proxy_pass http://192.168.58.159:8006/aicall/;
- 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_set_header X-Forwarded-Proto $scheme;
- }
- location /prod-api/common/ {
- proxy_pass http://192.168.58.159:8006/common/;
- 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_set_header X-Forwarded-Proto $scheme;
- }
- location /prod-api/company/ {
- proxy_pass http://192.168.58.159:8006/company/;
- 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_set_header X-Forwarded-Proto $scheme;
- }
- location /prod-api/companyWorkflow/ {
- proxy_pass http://192.168.58.159:8006/companyWorkflow/;
- 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_set_header X-Forwarded-Proto $scheme;
- }
- location /prod-api/qwAssignRule/ {
- proxy_pass http://192.168.58.159:8006/qwAssignRule/;
- 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_set_header X-Forwarded-Proto $scheme;
- }
- location /prod-api/qwCustomerLink/ {
- proxy_pass http://192.168.58.159:8006/qwCustomerLink/;
- 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_set_header X-Forwarded-Proto $scheme;
- }
- location /prod-api/qwGroupActual/ {
- proxy_pass http://192.168.58.159:8006/qwGroupActual/;
- 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_set_header X-Forwarded-Proto $scheme;
- }
- location /prod-api/qwGroupLiveCode/ {
- proxy_pass http://192.168.58.159:8006/qwGroupLiveCode/;
- 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_set_header X-Forwarded-Proto $scheme;
- }
- location /prod-api/shop/ {
- proxy_pass http://192.168.58.159:8006/shop/;
- 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_set_header X-Forwarded-Proto $scheme;
- }
- location /prod-api/workflow/ {
- proxy_pass http://192.168.58.159:8006/workflow/;
- 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_set_header X-Forwarded-Proto $scheme;
- }
- # 关键:反向代理 API(默认代理到 fs-admin 平台管理端)
- location /prod-api/ {
- proxy_pass http://192.168.58.159:7772/; # fs-admin 后端 API 地址(末尾加 / 避免路径拼接问题)
- 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_set_header X-Forwarded-Proto $scheme; # 传递 HTTPS 协议
- }
- }
- }
|