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