# ai-front-space **Repository Path**: exercise01/ai-front-space ## Basic Information - **Project Name**: ai-front-space - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-08-25 - **Last Updated**: 2025-08-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 1.打包部署注意事项 - 更改 package.json 中的配置: "homepage": "/ai-space/", - 执行打包命令: yarn build - 打包完成后执行命令可在本地运行打包后的文件: ferv ./build -b ai-space/ -s -c - 在服务器下创建“ai-space”文件夹 /www/wwwroot/web/ai-space - 将打包后build中的文件移动到 /www/wwwroot/web/ai-space 文件夹下 - 配置nginx: # 配置代理(进入详情页后刷新页面报404) location /ai-space/ { alias /www/wwwroot/web/ai-space/; try_files $uri $uri/ /ai-space/index.html; index index.html access_log logs/access.microweb.log access; error_log logs/error.microweb.443.log debug; add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE'; add_header 'Access-Control-Allow-Headers' 'reqid, nid, host, x-real-ip, x-forwarded-ip, event-type, event-id, accept, content-type'; } - 重启 nginx (配置完nginx后必须重启)