diff options
| author | saturneric <[email protected]> | 2025-11-09 02:21:35 +0000 |
|---|---|---|
| committer | saturneric <[email protected]> | 2025-11-09 02:21:35 +0000 |
| commit | c478d9ac769041e4b949bb9cf03d61269f77a936 (patch) | |
| tree | c3f3f6b9194f2f069f26dc9b89586a5b422db8f2 | |
| parent | style(css): update font usage and add dark mode support (diff) | |
| download | cgit-c478d9ac769041e4b949bb9cf03d61269f77a936.tar.gz cgit-c478d9ac769041e4b949bb9cf03d61269f77a936.zip | |
refactor(config): simplify URL rewrite rules
* Remove unused `mod_access` module to streamline server setup
* Replace complex rewrite logic with `url.rewrite-if-not-file` for
improved clarity and maintainability
* Clean up commented-out logging configuration for readability
| -rw-r--r-- | lighttpd.conf | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lighttpd.conf b/lighttpd.conf index 2caa18e..28f316b 100644 --- a/lighttpd.conf +++ b/lighttpd.conf @@ -1,16 +1,12 @@ server.port = 80 server.document-root = "/usr/share/webapps/cgit/" server.indexfiles = ("cgit.cgi") -server.modules += ( "mod_access", "mod_alias", "mod_cgi", "mod_rewrite", "mod_proxy", "mod_magnet" ) +server.modules += ( "mod_alias", "mod_cgi", "mod_rewrite", "mod_proxy", "mod_magnet" ) cgi.assign = ("cgit.cgi" => "") mimetype.assign = ( ".css" => "text/css" ) magnet.attract-raw-url-to = ( "/usr/lib/cgit/lua/redirect_lower_url.lua" ) -# log to stderr -# accesslog.filename = "/dev/stderr" -# accesslog.format = "%h %V %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-Agent}i\" %T" - # Proxy git http requests to gitea $HTTP["url"] =~ "^/(?!cgit\.cgi)(.+?)(?:\.git)?/(info/refs|git-upload-pack)$" { # only allow GET/POST methods @@ -27,7 +23,5 @@ $HTTP["url"] =~ "^/(?!cgit\.cgi)(.+?)(?:\.git)?/(info/refs|git-upload-pack)$" { else $HTTP["url"] =~ "^/" { # 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" - ) + url.rewrite-if-not-file = ( "^/(.*)$" => "/cgit.cgi/$1" ) }
\ No newline at end of file |
