| 123456789101112131415161718192021222324252627 |
- server {
- listen 80;
- server_name localhost;
- root /usr/share/nginx/html;
- index index.html;
- # 前端路由支持
- location / {
- try_files $uri $uri/ /index.html;
- }
- # API 代理
- location /api/ {
- proxy_pass http://backend:8010;
- 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 /health {
- proxy_pass http://backend:8010;
- proxy_set_header Host $host;
- }
- }
|