nginx + fossil configuration problem

Monthadar Al Jaberi monthadar at
Wed Nov 21 21:25:11 UTC 2012

On Wed, Nov 21, 2012 at 7:53 PM, Francis Daly <francis at> wrote:
> On Wed, Nov 21, 2012 at 07:16:41PM +0100, Monthadar Al Jaberi wrote:
> Hi there,
>> So I want localhost/fossil/aaa.
>> I moved the working location block inside the default server block:
>>       location /fossil/ {
>>             proxy_pass http://localhost:8080/;
>>       }
>> Now all my other cases work except the fossil one.
>> When I browse to localhost/fossil/aaa I see that the link changes to:
>>  http://localhost//aaa/index
>> An extra '/' is added somehow. The page I get is from nginx 404, which
>> I suppose means nginx did not proxy the request??
> No, nginx sent the request to fossil, which responded with a http redirect
> to this url. Then your browser asks nginx for //aaa/index, which does
> not exist as a file in the right place, hence 404.
>   curl -i http://localhost/fossil/aaa

I changed this line:

proxy_set_header Host $host;


proxy_set_header Host $host:$proxy_port;

And curl -i http://localhost/fossil/aaa returns:

HTTP/1.1 302 Moved Temporarily
Server: nginx/1.2.5
Date: Wed, 21 Nov 2012 21:22:10 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 79
Connection: keep-alive
Location: http://localhost:8080//aaa/index
X-Frame-Options: SAMEORIGIN
Cache-control: no-cache

<p>Redirect to Location: http://localhost:8080//aaa/index

So this redirection is just before calling fossil? Where do the extra
'/' come from? I read a litte more and found a directive called
rewrite, should I use it somehow to remove the xtra slash added?


> to see exactly what comes back.
> What you (probably) want is for that redirect to be to /fossil/aaa/index,
> which is (ideally) down to the fossil configuration.
> Newer versions of fossil tend to handle things a bit better; possibly
> setting baseurl to http://localhost/fossil (or maybe just /fossil)
> when you start the fossil service will allow things to work for you.
> Good luck with it,
>         f
> --
> Francis Daly        francis at
> _______________________________________________
> nginx mailing list
> nginx at

Monthadar Al Jaberi

More information about the nginx mailing list