On Wed, Sep 26, 2012 at 4:22 AM, Martijn Coppoolse < [email protected]> wrote:
> Hello Gautier, > > I have multiple repositories on a server which hosts other things (like >> internal tools accessible via a web browser, etc.), so I setup nginx with >> the reverse proxy module, my fossil server is accessible via /fossil/, but >> all media, css, etc. are seeked at /, they are not found, is there a place >> to set the root of the server, or is this a lack/bug? >> > > The HTML links generated by fossil always assume it's sitting in the root > path of the web server. AFAIK, there's no way to tell Fossil to prefix an > extra path to the root. > fossil server $repo --baseurl http://mydomain/path Supported for --baseurl added here: http://www.fossil-scm.org/fossil/info/ecb85f61a9 > > Perhaps that could be added as an extra option for the fossil http > command, I don’t know. (I have no idea what big an impact it would have -- > though seeing as 'fossil http' with a folder already prefixes the folder > name to the path, perhaps it wouldn’t be such a humongous change). > > In the meantime, I see two possible workarounds. > > 1. Personally, I’ve created a separate subdomain which points to the same > server, and set up nginx to proxy_pass all requests for the fossil > subdomain to fossil (which runs on a different port number). > > 2. You could also try to get nginx to rewrite the HTML that's returned to > the client using HttpSubModule[1] or even NginxHttpSubsModule[2], and > prefix your extra root path to any link in your URL starting with > double-quote and slash ("/). > > [1] > http://wiki.nginx.org/**HttpSubModule<http://wiki.nginx.org/HttpSubModule> > [2] > http://wiki.nginx.org/**NginxHttpSubsModule<http://wiki.nginx.org/NginxHttpSubsModule> > > For example: > > location / { > sub_filter '"/' '"/fossil/'; > sub_filter_once off; > } > > Of course, this assumes that links will always be in the form <a > href="/...">, or <img src="/...">, or <script src="/...">; this example > doesn't handle <a href='/...'>, which is just as valid HTML. > > > Also, I noticed that Chisel[3] does manage to host repositories on a > longer path, without breaking the HTML generated by fossil, so I’m assuming > he does some HTML rewriting as well. You could check out the source code[4] > to see how he does that (though I do note that he’s using Apache, and not > nginx). > > [3] http://chiselapp.com > [4] > http://chiselapp.com/user/**james/repository/chisel/<http://chiselapp.com/user/james/repository/chisel/> > > HTH, > -- > Martijn Coppoolse > > > ______________________________**_________________ > fossil-users mailing list > [email protected].**org <[email protected]> > http://lists.fossil-scm.org:**8080/cgi-bin/mailman/listinfo/**fossil-users<http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users> > -- D. Richard Hipp [email protected]
_______________________________________________ fossil-users mailing list [email protected] http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

