summaryrefslogtreecommitdiffstats
path: root/lighttpd.conf
diff options
context:
space:
mode:
authormischa <mischa@rx.high5.nl>2019-03-16 15:24:24 +0100
committermischa <mischa@rx.high5.nl>2019-03-16 15:24:24 +0100
commit9be3fe10a74019d8b8474f2829fea7c06f681e32 (patch)
tree22bf215ef9bfc38eba42e2d6ea0b0481bd915e85 /lighttpd.conf
Initial commit
Diffstat (limited to 'lighttpd.conf')
-rw-r--r--lighttpd.conf155
1 files changed, 155 insertions, 0 deletions
diff --git a/lighttpd.conf b/lighttpd.conf
new file mode 100644
index 0000000..62c70b5
--- /dev/null
+++ b/lighttpd.conf
@@ -0,0 +1,155 @@
+#
+# lighttpd configuration file
+#
+server.modules = (
+ "mod_auth",
+ "mod_expire",
+ "mod_compress",
+ "mod_rewrite",
+ "mod_redirect",
+ "mod_alias",
+ "mod_access",
+ "mod_setenv",
+ "mod_evhost",
+ "mod_fastcgi",
+ "mod_accesslog",
+ "mod_status",
+ "mod_openssl"
+)
+
+server.port = "80"
+server.bind = "0.0.0.0"
+$SERVER["socket"] == "[::]:80" { }
+$SERVER["socket"] == "[::]:443" { }
+$SERVER["socket"] == ":443" {
+ ssl.engine = "enable"
+ ssl.pemfile = "/usr/local/etc/acme/certs/example.com/combined.pem"
+ ssl.ca-file = "/usr/local/etc/acme/certs/example.com/chain.pem"
+}
+
+server.username = "www"
+server.groupname = "www"
+server.pid-file = "/var/run/lighttpd.pid"
+server.event-handler = "freebsd-kqueue"
+server.stat-cache-engine = "disable"
+server.max-write-idle = 720
+
+server.tag = "lighttpd"
+status.status-url = "/server-status"
+status.config-url = "/server-config"
+status.statistics-url = "/server-stats"
+
+server.document-root = "/usr/local/www/default/"
+server.error-handler-404 = "/404.html"
+accesslog.filename = "/usr/local/www/logs/lighttpd.access.log"
+server.errorlog = "/usr/local/www/logs/lighttpd.error.log"
+
+index-file.names = ("index.php", "index.html", "index.htm")
+url.access-deny = ("~", ".inc", ".sh", "sql", ".htaccess")
+static-file.exclude-extensions = (".php", ".pl", ".fcgi")
+server.dir-listing = "disable"
+
+alias.url += ("/.well-known/acme-challenge/" => "/usr/local/www/acme/")
+
+compress.cache-dir = "/tmp/lighttpdcompress/"
+compress.filetype = ("text/plain","text/css", "text/xml", "text/javascript")
+
+#auth.backend = "htpasswd"
+#auth.backend.htpasswd.userfile = "/usr/local/etc/lighttpd/htpasswd"
+
+# pdf fix
+$HTTP["url"] =~ "\.pdf$" {
+ server.range-requests = "disable"
+}
+# msie fix
+$HTTP["useragent"] =~ "^(.*MSIE.*)|(.*AppleWebKit.*)$" {
+ server.max-keep-alive-requests = 0
+}
+
+$HTTP["url"] =~ ".(js|css|png|jpg|jpeg|gif|ico)" {
+ expire.url = ( "" => "access plus 1 months" )
+}
+
+$HTTP["host"] =~ "www1.example.com" {
+ auth.require = ( "/admin/" => (
+ "method" => "basic",
+ "realm" => "Restricted",
+ "require" => "valid-user" )
+ )
+}
+
+$HTTP["host"] =~ "(www\.)?example.com" {
+ url.redirect = ("^/(.*)" => "https://www.example.com/$1")
+}
+
+$HTTP["host"] =~ "^(www.)?[^.]+\.[^.]+$" {
+ evhost.path-pattern = "/usr/local/www/www.%2.%1/"
+}
+
+url.rewrite = (
+ "^/(.*)\.(.+)$" => "$0",
+ "^/(.+)/?$" => "/index.php/$1"
+)
+
+fastcgi.server = ( ".php" =>
+ ( "localhost" =>
+ (
+ "host" => "127.0.0.1",
+ "port" => 9000
+ )
+ )
+)
+
+mimetype.assign = (
+ ".php" => "application/x-mapp-php5",
+ ".pdf" => "application/pdf",
+ ".sig" => "application/pgp-signature",
+ ".spl" => "application/futuresplash",
+ ".class" => "application/octet-stream",
+ ".ps" => "application/postscript",
+ ".torrent" => "application/x-bittorrent",
+ ".dvi" => "application/x-dvi",
+ ".gz" => "application/x-gzip",
+ ".pac" => "application/x-ns-proxy-autoconfig",
+ ".swf" => "application/x-shockwave-flash",
+ ".tar.gz" => "application/x-tgz",
+ ".tgz" => "application/x-tgz",
+ ".tar" => "application/x-tar",
+ ".zip" => "application/zip",
+ ".mp3" => "audio/mpeg",
+ ".m3u" => "audio/x-mpegurl",
+ ".wma" => "audio/x-ms-wma",
+ ".wax" => "audio/x-ms-wax",
+ ".ogg" => "audio/x-wav",
+ ".wav" => "audio/x-wav",
+ ".gif" => "image/gif",
+ ".jpg" => "image/jpeg",
+ ".jpeg" => "image/jpeg",
+ ".png" => "image/png",
+ ".xbm" => "image/x-xbitmap",
+ ".xpm" => "image/x-xpixmap",
+ ".xwd" => "image/x-xwindowdump",
+ ".css" => "text/css",
+ ".html" => "text/html",
+ ".htm" => "text/html",
+ ".js" => "text/javascript",
+ ".asc" => "text/plain",
+ ".c" => "text/plain",
+ ".conf" => "text/plain",
+ ".text" => "text/plain",
+ ".txt" => "text/plain",
+ ".dtd" => "text/xml",
+ ".xml" => "text/xml",
+ ".mpeg" => "video/mpeg",
+ ".mpg" => "video/mpeg",
+ ".mov" => "video/quicktime",
+ ".qt" => "video/quicktime",
+ ".avi" => "video/x-msvideo",
+ ".asf" => "video/x-ms-asf",
+ ".asx" => "video/x-ms-asf",
+ ".wmv" => "video/x-ms-wmv",
+ ".bz2" => "application/x-bzip",
+ ".tbz" => "application/x-bzip-compressed-tar",
+ ".tar.bz2" => "application/x-bzip-compressed-tar",
+ "" => "application/octet-stream"
+)