Configuring Hg as backend

Gautier DI FOLCO gautier.difolco at gmail.com
Tue Nov 27 16:10:02 UTC 2012


Hi all,

I'm trying to set up Hg behind nginx (web view, clone, pull, push)
following the
official wiki: http://mercurial.selenic.com/wiki/HgServeNginx.
I have created an empty repository ($ hg init t1), set up the following
file (hgweb):
[web]
allow_push = *
push_ssl = false
baseurl = http://localhost/hg/

[paths]
/ = /tmp/hg/*

And the following nginx.conf:
user              nginx;
worker_processes  1;
error_log  /var/log/nginx/error.log;
pid        /run/nginx.pid;
events {
    worker_connections  1024;
}
http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;
    access_log  /var/log/nginx/access.log  main;
    error_log  /var/log/nginx/error.log  error;
    sendfile        on;
    keepalive_timeout  65;
    include /etc/nginx/conf.d/*.conf;
    server {
        listen 80;
        server_name localhost;
    location ~ ^/hg/(.*)$ {
        proxy_pass         http://127.0.0.1:8000/$1;
    }
}
I launch $ hg serve --web-conf hgweb.
The web view works well, but $ hg clone http://localhost/hg/t1 fails. It
prints
abort: 'http://localhost/hg/t1/' does not appear to be an hg repository:
---%<--- (text/html; charset=UTF-8)
**html output**
---%<---
!
instead of $ hg clone http://localhost:8000/t1 works. Requests are
different:
 - With nginx:
127.0.0.1 - - [27/Nov/2012 16:21:08] "GET /t1/ HTTP/1.0" 200 -
127.0.0.1 - - [27/Nov/2012 16:21:08] "GET /t1/ HTTP/1.0" 200 -
127.0.0.1 - - [27/Nov/2012 16:21:08] "GET /t1/ HTTP/1.0" 200 -
127.0.0.1 - - [27/Nov/2012 16:21:08] "GET /t1/.hg/requires HTTP/1.0" 404 -
127.0.0.1 - - [27/Nov/2012 16:21:08] "GET /t1/.hg/00changelog.i HTTP/1.0"
404 -

 - Without nginx:
127.0.0.1 - - [27/Nov/2012 16:21:32] "GET /t1/?cmd=capabilities HTTP/1.1"
200 -
127.0.0.1 - - [27/Nov/2012 16:21:32] "GET /t1/?cmd=batch HTTP/1.1" 200 -
x-hgarg-1:cmds=heads+%3Bknown+nodes%3D
127.0.0.1 - - [27/Nov/2012 16:21:32] "GET /t1/?cmd=listkeys HTTP/1.1" 200 -
x-hgarg-1:namespace=phases
127.0.0.1 - - [27/Nov/2012 16:21:32] "GET /t1/?cmd=listkeys HTTP/1.1" 200 -
x-hgarg-1:namespace=bookmarks

is there some of you who have had the same issue? How did you solve the
problem?
Have you got ideas on how to solve it?

For your help,
Thanks by advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20121127/8364f652/attachment.html>


More information about the nginx mailing list