mercurial web server deployment on nginx

Jack Chu seiji22 at hotmail.com
Mon Aug 27 16:01:51 CDT 2007



Maxim Khitrov wrote:
> Actually, just found a much better solution. Wrote some simple set of
> rules to have nginx check for valid mercurial repositories. In my
> configuration I wanted http://<domain>/hg/ to be the list of all
> repositories available, so here's what I did:
> 
> location ^~ /hg/   {
> 	if ($request_uri ~ /hg(/.*)$) {
> 		set $path $1;
> 	}
> 	
> 	if ($path ~ ^/(?:static/.*)?$) {
> 		break;
> 	}
> 	
> 	if ($path ~ ^/([^/]+)) {
> 		set $hg /srv/hg/$1/.hg;
> 	}
> 	
> 	if (!-d $hg) {
> 		return 404;
> 	}

Thanks Maxim, this works pretty well. I've been trying to get mercurial to
work with nginx for a few days and have had no luck until I ran into this
thread. The only issue I have left is that the template/css files won't and
the sort links in the mercurial index page don't load. Any suggestions?
Thanks.
-- 
View this message in context: http://www.nabble.com/mercurial-web-server-deployment-on-nginx-tf4299334.html#a12357715
Sent from the Mercurial mailing list archive at Nabble.com.



More information about the Mercurial mailing list