I'm trying to set up a SVN repository on our new company server. We are using nginx for SSL termination and apache as SVN backend.
I don't know whats wrong with my configuration, but if I call svn info https://svn.example.com/repo I'm getting:
Redirecting to URL 'https://svn.example.com/repo': Redirecting to URL 'https://svn.example.com/repo': svn: E195019: Redirect cycle detected for URL 'https://svn.example.com/repo' If I use wireshark to sniff the unencrypted traffic from nginx frontend to our apache backend I can see an "Options" request for "/repo" followed by a 301 Moved Permanently redirect to http://svn.example.com/repo/. But the svn client apparently only sees a redirect to https://svn.example.com/repo (trailing slash stripped off by nginx) which it follows only to get this redirect again
I think my error is some simple configuration directive I forgot to set or something similar, but after googling for more than 3 hours without finding anything that helps, I'm feeling al little helpless.
My nginx cofiguration:
server { ssl on; ssl_certificate ssl/svn.example.com.crt; ssl_certificate_key ssl/svn.example.com.key; listen 1.2.3.4:443 ssl spdy; allow all; server_name svn.example.com; location / { set $fixed_destination $http_destination; if ( $http_destination ~* ^https(.*)$ ) { set $fixed_destination http$1; } proxy_set_header Destination $fixed_destination; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-By $server_addr:$server_port; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://127.0.0.1:8080; proxy_redirect http:// https://; } } And this is the apache virtual host config:
<VirtualHost *:8080> ServerName svn.example.com ServerAdmin [email protected] DocumentRoot /srv/svn <Directory /srv/svn> Options none AllowOverride None Order deny,allow Deny from all </Directory> <Location /> Order deny,allow Allow from all DAV svn SVNParentPath /srv/svn SVNReposName "Subversion Repository" #our access control policy AuthzSVNAccessFile /srv/svn/access #only authenticated users may access the repository Require valid-user #how to authenticate a user AuthType Basic AuthName "Subversion Repository" AuthUserFile /srv/svn/users Satisfy All </Location> ErrorLog ${APACHE_LOG_DIR}/svn_error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/svn_access.log combined </VirtualHost> My software versions:
# apache2ctl -v Server version: Apache/2.2.22 (Debian) Server built: Feb 1 2014 21:26:04 # nginx -v nginx version: nginx/1.6.0 #svn --version svn, version 1.8.9 (r1591380) compiled May 21 2014, 03:09:46 on x86_64-pc-linux-gnu Copyright (C) 2014 The Apache Software Foundation. This software consists of contributions made by many people; see the NOTICE file for more information. Subversion is open source software, see http://subversion.apache.org/ The following repository access (RA) modules are available: * ra_svn : Module for accessing a repository using the svn network protocol. - with Cyrus SASL authentication - handles 'svn' scheme * ra_local : Module for accessing a repository on local disk. - handles 'file' scheme * ra_serf : Module for accessing a repository via WebDAV protocol using serf. - using serf 1.3.6 - handles 'http' scheme - handles 'https' scheme Same svn version on the client.