rlgallery-misc/lighttpd/rlgallery.conf
John "Elwin" Edwards de10008bdb Update lighttpd configuration.
Explicitly set the document root, in case the default gets changed.
2022-01-02 20:40:05 -05:00

48 lines
1.2 KiB
Text

# lighttpd configuration file for rlgallery.org
# Include this file in your lighttpd.conf
# IPv4 and IPv6 addresses need to be explicitly specified
server.bind = "0.0.0.0"
$SERVER["socket"] == "[::]:80" { }
server.document-root := server_root + "/lighttpd"
# Ensure index.cgi is in the list
index-file.names += (
"index.xhtml", "index.html", "index.htm", "index.cgi"
)
server.modules += ( "mod_cgi", "mod_setenv", "mod_redirect" )
cgi.assign = ( ".cgi" => "" )
# The old static high score page now redirects to the CGI script
$HTTP["host"] =~ "^(.*)$" {
url.redirect = (
"^/scoring/highscores.html" => "http://%1/scoring/high.cgi?l=40"
)
}
# Don't send CGI scripts or python scripts as static files
static-file.exclude-extensions += ( ".cgi", ".py" )
# Use the custom 404 error page
server.error-handler-404 = "/404.html"
# Set a UTF-8 environment, or Python 3 won't work
setenv.add-environment = (
"LC_CTYPE" => "en_US.utf8"
)
setenv.add-response-header = (
"Permissions-Policy" => "interest-cohort=()"
)
# Turn on directory listing where it is needed
$HTTP["url"] =~ "^/files/" {
dir-listing.activate = "enable"
}
$HTTP["url"] =~ "^/ttyrecs/" {
dir-listing.activate = "enable"
}