summaryrefslogtreecommitdiff
path: root/usr/local/etc/lighttpd
diff options
context:
space:
mode:
author53hornet <atc@53hor.net>2022-01-17 23:14:29 -0500
committer53hornet <atc@53hor.net>2022-01-17 23:14:29 -0500
commitf1196ed37bdac83ad34b895d23864caad75ad668 (patch)
tree9e8fcff8e9f2c19815bd39b1fbd739de20e9b43f /usr/local/etc/lighttpd
parent53cab55111b465e4edfd37f5300fc62ca1fe6e2c (diff)
downloadcgit-f1196ed37bdac83ad34b895d23864caad75ad668.tar.xz
cgit-f1196ed37bdac83ad34b895d23864caad75ad668.zip
feat: add and support pretty permalinksHEADmaster
Diffstat (limited to 'usr/local/etc/lighttpd')
-rw-r--r--usr/local/etc/lighttpd/conf.d/rewrite.conf4
-rw-r--r--usr/local/etc/lighttpd/lighttpd.conf6
2 files changed, 8 insertions, 2 deletions
diff --git a/usr/local/etc/lighttpd/conf.d/rewrite.conf b/usr/local/etc/lighttpd/conf.d/rewrite.conf
new file mode 100644
index 0000000..f1ba97f
--- /dev/null
+++ b/usr/local/etc/lighttpd/conf.d/rewrite.conf
@@ -0,0 +1,4 @@
+server.modules += ( "mod_rewrite" )
+url.rewrite-once = (
+ "^/([^?/]+/[^?]*)?(?:\?(.*))?$" => "/cgit.cgi?url=$1&$2",
+)
diff --git a/usr/local/etc/lighttpd/lighttpd.conf b/usr/local/etc/lighttpd/lighttpd.conf
index 277ac25..b7e3272 100644
--- a/usr/local/etc/lighttpd/lighttpd.conf
+++ b/usr/local/etc/lighttpd/lighttpd.conf
@@ -2,11 +2,13 @@ var.log_root = "/var/log/lighttpd"
include "conf.d/access_log.conf"
include "conf.d/mime.conf"
include "conf.d/cgi.conf"
-index-file.names += ("cgit.cgi")
+include "conf.d/rewrite.conf"
+index-file.names = ("cgit.cgi")
+server.name = "git.53hor.net"
server.document-root = "/usr/local/www/cgit"
server.errorlog = log_root + "/error.log"
server.breakagelog = log_root + "/breakage.log"
server.network-backend = "sendfile"
server.port = 80
-server.username = "www"
+server.username = "www"
server.groupname = "www"