502 Bad Gateway and subversion

If you get a 502 Bad Gateway message when moving a file in subversion via WebDAV interface over HTTPS on Apache and without using a proxy, you may have misconfigured SSL in Apache.

I was getting that error but when searching the web for a solution, I only found people having the problem when using an HTTPS proxy redirecting to a subversion on HTTP.

Until I found this thread. The problem is that SSL directives are not specified for the virtual host used for subversion (I have several virtual host and I forgot to put the directives for this one).

<VirtualHost *:443>
  ServerName svn.foo.bar
  ServerAdmin webmaster@foo.bar

  SSLEngine on
  SSLCertificateFile /etc/apache2/ssl/ssl.crt
  SSLCertificateKeyFile /etc/apache2/ssl/ssl.key

  <location />
    DAV svn

    SVNPath /path/to/svn/repository

    AuthType Basic
    AuthName "Subversion Repository"
    AuthUserFile /path/to/dav_svn.passwd
    AuthzSVNAccessFile /path/to/dav_svn.authz

    Require valid-user
  </location>
</VirtualHost>

The three lines starting with SSL where missing, but SSL was working since other virtual hosts were already declaring it.

Comments Add one by sending me an email.