修复: Nginx配置中/s/路径的proxy_set_header变量转义问题
- 在configure_nginx_http()和configure_nginx_https()中 - 将$host、$remote_addr等Nginx变量正确转义 - 修复'invalid number of arguments'错误
This commit is contained in:
16
install.sh
16
install.sh
@@ -1198,10 +1198,10 @@ server {
|
|||||||
# 分享页面(代理到后端处理重定向)
|
# 分享页面(代理到后端处理重定向)
|
||||||
location /s/ {
|
location /s/ {
|
||||||
proxy_pass http://localhost:${BACKEND_PORT};
|
proxy_pass http://localhost:${BACKEND_PORT};
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host \$host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP \$remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto \$scheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
# 静态资源
|
# 静态资源
|
||||||
@@ -1274,10 +1274,10 @@ server {
|
|||||||
# 分享页面(代理到后端处理重定向)
|
# 分享页面(代理到后端处理重定向)
|
||||||
location /s/ {
|
location /s/ {
|
||||||
proxy_pass http://localhost:${BACKEND_PORT};
|
proxy_pass http://localhost:${BACKEND_PORT};
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host \$host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP \$remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto \$scheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
# 静态资源
|
# 静态资源
|
||||||
|
|||||||
Reference in New Issue
Block a user