On Wed, May 28, 2014 at 01:08:26AM +0000, Joe Prostko wrote:
> On Tue, May 27, 2014 at 11:31 PM, Warren Young <war...@etr-usa.com> wrote:

Hi there,

> > 1. You don't need to do regex matching on the URL here.  This does the same
> > thing more efficiently and more clearly:
> >
> >     location /demo_project/ {

> I always write this as:
> 
> location ~ ^/demo_project {
> 
> myself.  That way, it's a case-sensitive search where I don't have to
> worry about the trailing slash, and it stops searching once it finds
> /demo_project.  I could be mistaken though, but I thought the way you
> suggested wouldn't be as flexible.

This is nginx-config information now, and useful if someone wants to
use nginx as a reverse proxy for fossil. That's the (tenuous) link for
me putting it on this list...

The "location" lines above -- and the ones in the fossil documentation --
are all mostly equivalent if they are the only "location" blocks in the
config. ("mostly" would be "exactly" if they all ended with or without
the slash.)

Where they differ is if there is another "location" line, such as
"location ~ php". In that case, if you request /demo_project/dir/file.php,
which "location" is used will depend on other things.

The "proper" nginx way would be to write it as two separate locations:

  location = /demo_project {return 301 /demo_project/;}

  location ^~ /demo_project/ { # all the rest }

although there is magic within nginx to make the first location
unnecessary in this case.

So: leave the fossil documentation as-is and expect that anyone actually
using nginx will have read the nginx documentation to properly integrate
the working example into their config if they are doing something more
complicated; or change the fossil documentation to include the "^~"
and make it look less obvious to anyone not using nginx.

Either works; what is there currently is not incorrect.

        f
-- 
Francis Daly        fran...@daoine.org
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to