blob: 76a4aae0df947398408f40f62a4c1e85aeb4bbe4 [file] [log] [blame]
223010806af19da2025-06-03 16:57:13 +08001server {
2 listen 80; # 代理默认端口,可改
DREW7c7c6a02025-06-05 19:58:55 +08003 server_name team2.10813352.xyz;
223010806af19da2025-06-03 16:57:13 +08004
5 root /var/www/html;
6 index index.html;
7
DREW7c7c6a02025-06-05 19:58:55 +08008
223010806af19da2025-06-03 16:57:13 +08009
10 # 代理 /api/v1/ 到后端服务
11 location /api/v1/ {
DREW7c7c6a02025-06-05 19:58:55 +080012 proxy_pass http://localhost:8088; # 你的后端暴露位置
223010806af19da2025-06-03 16:57:13 +080013 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
DREW7c7c6a02025-06-05 19:58:55 +080020 location = /favicon.ico { log_not_found off}; access_log off; }
21 location = /robots.txt { log_not_found off}; access_log off; allow all; }
223010806af19da2025-06-03 16:57:13 +080022 location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
23 expires max;
24 log_not_found off;
25 }
26}