aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lighttpd.conf32
1 files changed, 21 insertions, 11 deletions
diff --git a/lighttpd.conf b/lighttpd.conf
index c103439..f68c3e8 100644
--- a/lighttpd.conf
+++ b/lighttpd.conf
@@ -1,24 +1,34 @@
server.port = 80
-server.document-root = "/usr/share/webapps/cgit"
-index-file.names = ( "cgit.cgi" )
-
+server.document-root = "/usr/share/webapps/cgit/"
+server.indexfiles = ("cgit.cgi")
server.modules += ( "mod_access", "mod_alias", "mod_cgi", "mod_rewrite", "mod_proxy", "mod_accesslog" )
-cgi.assign = ( ".cgi" => "" )
+
+cgi.assign = ("cgit.cgi" => "")
mimetype.assign = ( ".css" => "text/css" )
# log to stderr
accesslog.filename = "/dev/stderr"
accesslog.format = "%h %V %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-Agent}i\" %T"
-# reserve proxy for gitea git service
+# Proxy git http requests to gitea
$HTTP["url"] =~ "^/(.+?)\.git/(info/refs|git-upload-pack)$" {
$HTTP["request-method"] !~ "^(GET|POST)$" {
- url.access-deny = ( "" )
+ url.access-deny = ("")
}
- proxy.server = ( "" => ( ( "host" => "gitea", "port" => 3000 ) ) )
+
+ proxy.server = (
+ "" => ((
+ "host" => "gitea",
+ "port" => 3000,
+ ))
+ )
}
+else $HTTP["url"] =~ "^/" {
+
-# rewrite all requests to cgit.cgi except for static files
-url.rewrite-once = (
- "^/((?!cgit\.(css|png)$)(?!favicon\.ico$)(?!robots\.txt$).*)$" => "/cgit.cgi/$1"
-) \ No newline at end of file
+ # Rewrite any other url but the asset urls to be handled by the cgit
+ # executable. Use with virtual-root=/ cgitrc setting.
+ url.rewrite-once = (
+ "^/((?!cgit\.(css|png)$)(?!favicon\.ico$)(?!robots\.txt$).*)$" => "/cgit.cgi/$1"
+ )
+} \ No newline at end of file