🔧 更新install.sh - 添加Nginx Cookie传递配置
## 修改说明 install.sh生成的Nginx配置中缺少Cookie传递设置, 导致验证码session无法正常工作。 ## 修改内容 ### install.sh 在3处 `location /api` 配置中添加Cookie传递: ```nginx # Cookie传递配置(验证码session需要) proxy_set_header Cookie $http_cookie; proxy_pass_header Set-Cookie; ``` 修改位置: - 行2383: HTTP配置(configure_nginx_http_first) - 行2665: HTTPS配置(configure_nginx_final) - 行2802: 虚拟主机配置 ### 新增文件 1. **fix_install_sh.sh** - 自动化修改脚本 - 备份原文件后自动添加Cookie配置 - 可重复运行(检测已修改则跳过) 2. **INSTALL_SH_UPDATE.md** - 详细的修改说明文档 - 手动修改方法 - 验证和应用指南 ## 使用方法 ### 新部署 直接运行修改后的install.sh即可 ### 自动修改 ```bash ./fix_install_sh.sh ``` ### 已部署服务 需要手动更新Nginx配置: ```bash vim /etc/nginx/conf.d/玩玩云.conf # 在 location /api 块中添加Cookie配置 nginx -t nginx -s reload ``` ## 配套修复 此修改配合以下提交才能完整工作: - 后端session配置 (7ce9d95) - 前端axios配置 (83773ef) - nginx/nginx.conf (5f3fd38) - install.sh (本提交) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
12
install.sh
12
install.sh
@@ -2380,6 +2380,10 @@ server {
|
||||
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto \$scheme;
|
||||
|
||||
# Cookie传递配置(验证码session需要)
|
||||
proxy_set_header Cookie $http_cookie;
|
||||
proxy_pass_header Set-Cookie;
|
||||
|
||||
# 上传超时设置
|
||||
proxy_read_timeout 3600s;
|
||||
proxy_send_timeout 3600s;
|
||||
@@ -2658,6 +2662,10 @@ server {
|
||||
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto \$scheme;
|
||||
|
||||
# Cookie传递配置(验证码session需要)
|
||||
proxy_set_header Cookie $http_cookie;
|
||||
proxy_pass_header Set-Cookie;
|
||||
|
||||
# 上传超时设置(大文件上传需要更长时间,设置为1小时)
|
||||
proxy_read_timeout 3600s;
|
||||
proxy_send_timeout 3600s;
|
||||
@@ -2791,6 +2799,10 @@ server {
|
||||
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto \$scheme;
|
||||
|
||||
# Cookie传递配置(验证码session需要)
|
||||
proxy_set_header Cookie $http_cookie;
|
||||
proxy_pass_header Set-Cookie;
|
||||
|
||||
# 上传超时设置(大文件上传需要更长时间,设置为1小时)
|
||||
proxy_read_timeout 3600s;
|
||||
proxy_send_timeout 3600s;
|
||||
|
||||
Reference in New Issue
Block a user