FYI: apache2 + svn + nginx

Konstantin Arkhipov voxus at infonet.ee
Thu May 19 18:34:26 MSD 2005


добрый вечер,

	ежели кого заинтересует, небольшой how to по сабжу (возможным стало с 
nginx-0.1.32):

apache/vhosts.d/vhosts.conf:

	NameVirtualHost 127.0.0.1:80

	<VirtualHost 127.0.0.1:80>
		ServerName svn.domain.org
		
		...

		<Location /repo>
			DAV svn
			SVNPath /var/svn/repo
			AuthType Basic
			AuthName "Subversion repository"

			AuthUserFile /var/svn/repo/conf/svnusers
			Require valid-user
                </Location>

		...

	</VirtualHost>		

nginx.conf:

	server {
		listen whateverICanListenFor:443;

		server_name svn.domain.org;

		ssl on;
		ssl_certificate	/etc/apache2/ssl/server.crt;
		ssl_certificate_key	/etc/apache2/ssl/server.key;

		location / {
			# to avoid 502 Bad Gateway:
			# http://vanderwijk.info/Members/ivo/articles/ComplexSVNSetupFix
			set $destination $http_destination;

			if ($destination ~* ^https(.+)$) {
				set $destination http$1;
			}

			# beware: this will drop any inherited proxy_set_header's
			proxy_set_header Destination $destination;
			proxy_set_header Host $host;
			proxy_set_header X-Real-IP $remote_addr;

			proxy_pass http://localhost/;
			proxy_redirect http://localhost/ https://svn.domain.org/;
                }
        }

-- 
voxus
:wq





More information about the nginx-ru mailing list