Mike Gerwitz

Free Software Hacker+Activist

aboutsummaryrefslogtreecommitdiffstats
blob: c66e7da6e4b3deaa576cd7b841bb726d7a98d2e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Lighttpd server configuration for mikegerwitz.com
#
# This file has accumulated a lot of cruft over the years, a lot of which is
# probably no longer necessary.  Most of the redirections handle transitions
# form older version of the site.
#
# This site uses cgit at /projects, but is otherwise a static website.
##

$HTTP["scheme"] == "https" {
  $HTTP["host"] =~ "^www.mikegerwitz\.com" {
    url.redirect = ( "^(.*)$" => "https://mikegerwitz.com$0" )
  }

  $HTTP["host"] =~ "^mikegerwitz\.com" {
    server.document-root = "/home/mikegerwitz/main/com"
    server.errorlog = "/var/log/lighttpd/mikegerwitz-error.log"
    accesslog.filename = "/var/log/lighttpd/mikegerwitz-access.log"
    server.errorfile-prefix = "/home/mikegerwitz/main/com/"

    url.redirect = (
      # old URL
      "^/2[0-9]{3}/[0-9]+/[0-9]+/(.*)$" => "/$1",
      "^/papers/git-horror-story" => "/2012/05/a-git-horror-story-repository-integrity-with-signed-commits",
      "^/thoughts(/.*)?$" => "/$1",
      "./rss(\.xml)?$" => "/rss",   # trailing RSS requests
      "^/feed/?" => "/rss",
      "^/resume/?" => "/about/resume",
      "^/hoxsl$" => "/hoxsl/",
      "^/docs/(.*).html" => "/papers/$1",
      "^/talks/sapsf/?$" => "/talks/sapsf.pdf",
      "^/talks/ethics-void/?$" => "/talks/ethics-void.pdf",
      "^/projects/$" => "/projects",
    )

    url.rewrite-once = (
      "^/\.well-known/.*" => "$0",
      "^/[0-9]{4}/[0-9]{2}/.*[A-Z].*$" => "/redirect-map.php?path=$0",
      "^/projects/static/.*" => "$0",
      "^/projects$" => "/cgit.cgi",
      "^/projects/([^?/]+(/[^?]*)?)?(?:\?(.*))?$" => "/cgit.cgi?url=$1&$3",
      "^/rss/?" => "/rss.xml",
      "^/.+\.[a-zA-Z]+$" => "$0",
      "^/docs/.*?$" => "$0",
      "^/hoxsl/.*?$" => "$0",
      "^/talks/sapsf/?$" => "$0",
      "^/talks/ethics-void/?$" => "$0",
      "^/(.+?)/?$" => "/$1.html",
    )

    alias.url = (
      "/cgit.cgi" => "/usr/lib/cgit/cgit.cgi",
      "/projects/static/" => "/usr/share/cgit/",
    )
    cgi.assign = (
      "/usr/lib/cgit/cgit.cgi" => "",
    )
  }
}