使用 NGINX 安装 SVN 服务器

Ala*_*ari 3 nginx svn apache-2.2

我正在尝试安装 SVN 服务器并将其与我的 NGINX 网络服务器一起使用。我已经
在 nginx/sites-enabled/svn 的服务器部分尝试过这个我已经添加了这个

  位置 /var/svn/repos {
        proxy_pass http://127.0.0.1:81;
        #include /etc/nginx/proxy.conf;
        设置 $dest $http_destination;
        if ($http_destination ~ "^https://(.+)") {
           设置 $dest http://$1;
        }
       proxy_set_header 目的地 $dest;
        }

并且我在端口 81 上运行 apache 并制作了在 apache 上运行 100% 的虚拟主机。现在每当我尝试 svn checkout 时,我都会得到这个:

$ svn co http://svn.mysite.com/myrepo
svn:服务器发送意外返回值(500 内部服务器错误)以响应“http://svn.mysite.com/myrepo”的 OPTIONS 请求

在错误日志中我有这个

2012/04/18 07:43:36 [错误] 9914#0:*106 重写或内部重定向循环,而内部重定向到“/index.html”,客户端:93.95.201.250,服务器:mysite.com,请求:“ GET /myrepo HTTP/1.1”,主机:“svn.mysite.com”

有人知道如何在 nginx 上安装 svn 服务器吗?任何想法都受到高度赞赏?
谢谢你的帮助

小智 5

我在这样的事情上取得了成功。您可能能够进一步简化它,但它可能会为您提供一个有效的配置。

在 nginx.conf(或 /etc/nginx/conf.d 下的其他 .conf 文件)中:

location /var/svn/repos {
    # the "proxy_set_header Destination"-stuff is moved to apache's config - see below
    proxy_pass http://127.0.0.1:81/var/svn/repos;
}
Run Code Online (Sandbox Code Playgroud)

然后在/etc/httpd/conf.d/subversion.conf

...
<VirtualHost *:81>
    RequestHeader edit Destination ^https http early

    <Location /var/svn/repos>
        DAV svn
        SVNPath /var/svn/repos
    </Location>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)