Browse files

gitweb.conf(5): gitweb as directory handler and $base_url

Add a paragraph to description of $base_url variable in gitweb.conf(5)
manpage explaining when and why one might need to set it, and how.
Also add a note about $base_url to example configuration for serving
gitweb using FastCGI in gitweb(1).

Based-on-report-by: José María Escartín Esteban <>
Signed-off-by: Jakub Narębski <>
  • Loading branch information...
jnareb committed May 8, 2012
1 parent fd9e369 commit 12c0cfa46911c809ce1d421134d98920d015b142
Showing with 16 additions and 0 deletions.
  1. +12 −0 Documentation/gitweb.conf.txt
  2. +4 −0 Documentation/gitweb.txt
@@ -566,6 +566,18 @@ $base_url::
PATH_INFO. Usually gitweb sets its value correctly,
and there is no need to set this variable, e.g. to $my_uri or "/".
See `$per_request_config` if you need to override it anyway.
+You would need to set this variable when using path_info-based URLs
+while using gitweb as a directory handler (which means that full path
+to browse repositories looks like ``
+rather than ``).
+In such case `$base_url` needs to end with slash, to denote that it is
+$base_url .= '/' unless ($base_url =~ m!/$!);
@@ -473,6 +473,10 @@ With that configuration the full path to browse repositories would be:
+Note that for this configuration `$base_url` must be set to end with
+'/', as described in linkgit:gitweb.conf[5], for gitweb to correctly
+serve static files when using path_info URLs.
As PSGI using plackup
Gitweb can run as PSGI app (via emulation with *CGI::Emulate::PSGI*(3pm)).

0 comments on commit 12c0cfa

Please sign in to comment.