location ~ /(svn|!) {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering on;
#处理svn: E175002: Unexpected HTTP status 502 'Bad Gateway' on
set $fixed_destination $http_destination;
if ( $http_destination ~* ^https(.*)$ ) {
set $fixed_destination http$1;
}
proxy_set_header Destination $fixed_destination;
proxy_pass http://127.0.0.1:7080;
}
Nginx+SVN
最新推荐文章于 2025-01-16 14:35:48 发布
该配置段主要针对Nginx服务器,旨在处理svn请求时出现的E175002错误和HTTP502BadGateway问题。通过设置proxy_redirect、proxy_set_header以及调整proxy_buffering,优化了请求转发到本地7080端口的HTTP服务。同时,针对HTTPS重定向进行了特殊处理。
6073

被折叠的 条评论
为什么被折叠?



