AgileBoot-Front-End/nginx/default.conf
cuijiawang 8fcdf09999 build(deployment): 更新生产环境配置并添加 Nginx 配置
- 修改 .env.production 中的 VITE_APP_BASE_API 为 /dev-api
- 新增 nginx/default.conf 配置文件,设置 Nginx 服务器配置
- 更新 Dockerfile,使用内部 Nexus 仓库作为 npm registry
- 调整 vite.config.ts 中的开发代理端口为 18080
2025-07-31 15:02:58 +08:00

40 lines
1017 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

server {
listen 80;
server_name localhost;
#gzip config
gzip on;
gzip_buffers 32 4k;
gzip_comp_level 6;
gzip_min_length 100;
gzip_types application/javascript text/css text/xml;
gzip_disable "MSIE [1-6]\."; #配置禁用gzip条件支持正则。此处表示ie6及以下不启用gzip因为ie低版本不支持
gzip_vary on;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
}
location ~ ^/dev-api/(?<path>.*) {
proxy_pass http://172.18.0.25:18080/$path$is_args$args;
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 /nginx-health {
access_log off;
return 200 "OK";
add_header Content-Type text/plain;
}
}