Welcome! Log In Create A New Profile

Advanced

Re: nginx + fossil configuration problem

Francis Daly
November 21, 2012 05:44PM
On Wed, Nov 21, 2012 at 10:44:11PM +0100, Monthadar Al Jaberi wrote:

Hi there,

> I think I got it to work using rewrite.

I think you are bypassing nginx. That's fine if you want to; but in that
case you could have just gone to fossil directly in the first place.

Try http://192.168.0.101/fossil/aaa

If you see "8080" in your browser bar, you're not using nginx.

> location /fossil {

Change that to "location /fossil/ {" or (better) "location ^~ /fossil/ {"

> rewrite /fossil/(.*) /$1 break;

Remove that.

> proxy_pass http://localhost:8080;
> proxy_redirect off;
> proxy_set_header Host $host:$proxy_port;

Change that back to "proxy_set_header Host $host;"

> proxy_set_header X-Real-IP $remote_addr;
> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

I don't think those lines make any difference to fossil. It's clearer
to remove them, too.

> }
>
>
> I hope this is a sane solution :)

I don't think that it will work from off your own server.

If it does what you want, then it is good enough. But I think that when
you test from another machine, you will see a problem.

Even after you put it back the way it was, you still will not see it work
cleanly, because your fossil is not configured to be reverse proxied at
a different url. By that, I mean: you request http://server/fossil/aaa,
but fossil returns links and redirections assuming that you requested
http://server/aaa (which, as far as fossil is concerned, you did).

The current way to adjust fossil to be reverse proxied at a different
place in the url hierarchy seems to be to start it like

SCRIPT_NAME=/fossil fossil server /path/to/fossils/

(and that means that you won't be able to access it directly at
http://localhost:8080/aaa).

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx + fossil configuration problem

Monthadar Al Jaberi November 20, 2012 04:30PM

Re: nginx + fossil configuration problem

Francis Daly November 20, 2012 06:26PM

Re: nginx + fossil configuration problem

Monthadar Al Jaberi November 21, 2012 01:18PM

Re: nginx + fossil configuration problem

Monthadar Al Jaberi November 21, 2012 01:34PM

Re: nginx + fossil configuration problem

Francis Daly November 21, 2012 01:56PM

Re: nginx + fossil configuration problem

Monthadar Al Jaberi November 21, 2012 04:26PM

Re: nginx + fossil configuration problem

Monthadar Al Jaberi November 21, 2012 04:46PM

Re: nginx + fossil configuration problem

Francis Daly November 21, 2012 05:44PM

Re: nginx + fossil configuration problem

Francis Daly November 21, 2012 05:20PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 242
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready