22301080 | 6af19da | 2025-06-03 16:57:13 +0800 | [diff] [blame] | 1 | server { |
| 2 | listen 80; # 代理默认端口,可改 |
DREW | 7c7c6a0 | 2025-06-05 19:58:55 +0800 | [diff] [blame^] | 3 | server_name team2.10813352.xyz; |
22301080 | 6af19da | 2025-06-03 16:57:13 +0800 | [diff] [blame] | 4 | |
| 5 | root /var/www/html; |
| 6 | index index.html; |
| 7 | |
DREW | 7c7c6a0 | 2025-06-05 19:58:55 +0800 | [diff] [blame^] | 8 | |
22301080 | 6af19da | 2025-06-03 16:57:13 +0800 | [diff] [blame] | 9 | |
| 10 | # 代理 /api/v1/ 到后端服务 |
| 11 | location /api/v1/ { |
DREW | 7c7c6a0 | 2025-06-05 19:58:55 +0800 | [diff] [blame^] | 12 | proxy_pass http://localhost:8088; # 你的后端暴露位置 |
22301080 | 6af19da | 2025-06-03 16:57:13 +0800 | [diff] [blame] | 13 | proxy_http_version 1.1; |
| 14 | proxy_set_header Upgrade $http_upgrade; |
| 15 | proxy_set_header Connection 'upgrade'; |
| 16 | proxy_set_header Host $host; |
| 17 | proxy_cache_bypass $http_upgrade; |
| 18 | } |
| 19 | |
DREW | 7c7c6a0 | 2025-06-05 19:58:55 +0800 | [diff] [blame^] | 20 | location = /favicon.ico { log_not_found off}; access_log off; } |
| 21 | location = /robots.txt { log_not_found off}; access_log off; allow all; } |
22301080 | 6af19da | 2025-06-03 16:57:13 +0800 | [diff] [blame] | 22 | location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ { |
| 23 | expires max; |
| 24 | log_not_found off; |
| 25 | } |
| 26 | } |