Project

General

Profile

Bug #3084 » lighttpd.conf

ZivHung, 2021-06-01 02:14

 
1
server.document-root = "/usr/web/"
2

    
3
server.port = 443
4
ssl.engine = "enable"
5
ssl.pemfile = "/usr/etc/lighttpd.crt"
6
ssl.privkey = "/usr/etc/lighttpd.pem"
7
ssl.openssl.ssl-conf-cmd = ("MinProtocol" => "TLSv1.2",
8
	                            "Options" => "-ServerPreference, -SessionTicket",
9
								"CipherString" => "EECDH+AESGCM:AES256+EECDH:CHACHA20")
10
server.stream-request-body = 2
11
server.stream-response-body = 2
12
server.tag = " "
13
ssl.read-ahead = "disable"
14

    
15

    
16
# 100MB
17
server.max-request-size  = 104857600
18
server.network-backend="writev"
19
server.upload-dirs=("/tmp")
20

    
21
# listen to ipv6
22
# $SERVER["socket"] == "[::]:41931" {  }
23

    
24
# server.username = "root"
25
# server.groupname = "root"
26

    
27
mimetype.assign = (
28
	".pdf"          =>      "application/pdf",
29
  ".sig"          =>      "application/pgp-signature",
30
  ".spl"          =>      "application/futuresplash",
31
  ".class"        =>      "application/octet-stream",
32
  ".ps"           =>      "application/postscript",
33
  ".torrent"      =>      "application/x-bittorrent",
34
  ".dvi"          =>      "application/x-dvi",
35
  ".gz"           =>      "application/x-gzip",
36
  ".pac"          =>      "application/x-ns-proxy-autoconfig",
37
  ".swf"          =>      "application/x-shockwave-flash",
38
  ".tar.gz"       =>      "application/x-tgz",
39
  ".tgz"          =>      "application/x-tgz",
40
  ".tar"          =>      "application/x-tar",
41
  ".zip"          =>      "application/zip",
42
  ".mp3"          =>      "audio/mpeg",
43
  ".m3u"          =>      "audio/x-mpegurl",
44
  ".wma"          =>      "audio/x-ms-wma",
45
  ".wax"          =>      "audio/x-ms-wax",
46
  ".ogg"          =>      "application/ogg",
47
  ".wav"          =>      "audio/x-wav",
48
  ".gif"          =>      "image/gif",
49
  ".jpg"          =>      "image/jpeg",
50
  ".jpeg"         =>      "image/jpeg",
51
  ".png"          =>      "image/png",
52
  ".xbm"          =>      "image/x-xbitmap",
53
  ".xpm"          =>      "image/x-xpixmap",
54
  ".xwd"          =>      "image/x-xwindowdump",
55
  ".css"          =>      "text/css",
56
  ".html"         =>      "text/html",
57
  ".htm"          =>      "text/html",
58
  ".js"           =>      "text/javascript",
59
  ".asc"          =>      "text/plain",
60
  ".c"            =>      "text/plain",
61
  ".cpp"          =>      "text/plain",
62
  ".log"          =>      "text/plain",
63
  ".conf"         =>      "text/plain",
64
  ".text"         =>      "text/plain",
65
  ".txt"          =>      "text/plain",
66
  ".dtd"          =>      "text/xml",
67
  ".xml"          =>      "text/xml",
68
  ".mpeg"         =>      "video/mpeg",
69
  ".mpg"          =>      "video/mpeg",
70
  ".mp4"          =>      "video/mp4",
71
  ".mov"          =>      "video/quicktime",
72
  ".qt"           =>      "video/quicktime",
73
  ".avi"          =>      "video/x-msvideo",
74
  ".asf"          =>      "video/x-ms-asf",
75
  ".asx"          =>      "video/x-ms-asf",
76
  ".wmv"          =>      "video/x-ms-wmv",
77
  ".bz2"          =>      "application/x-bzip",
78
  ".tbz"          =>      "application/x-bzip-compressed-tar",
79
  ".tar.bz2"      =>      "application/x-bzip-compressed-tar",
80
  "" => ""
81
)
82

    
83
server.modules = (
84
  "mod_access",
85
  "mod_fastcgi",
86
  "mod_authn_file",
87
  "mod_auth", 
88
  "mod_setenv",  
89
  "mod_proxy",
90
  #"mod_cgi",
91
  "mod_openssl",
92
  "mod_redirect",
93
  "mod_alias",
94
  "mod_wstunnel",
95
)
96

    
97
# websocket to RTSP with URI (*/webrtsp)
98
$HTTP["url"] =~ "^/webrtsp" {
99
    wstunnel.ping-interval = 20
100
    wstunnel.server = ( "" => ( ( "host" => "0.0.0.0", "port" => "554") ) )
101
    wstunnel.frame-type = "binary" 
102
    server.stream-request-body  = 2
103
    server.stream-response-body = 2
104
    server.max-read-idle = 120
105
}else $HTTP["url"] != "" {
106
  setenv.add-response-header = ("Cache-Control" => "no-store, no-cache, must-revalidate, post-check=0, pre-check=0", 
107
  "Strict-Transport-Security" => "max-age=63072000",     
108
  "X-Frame-Options" => "DENY",
109
  "X-Content-Type-Options" => "nosniff",
110
  "X-Xss-Protection" => "1; mode=block"
111
  )
112
  etag.use-inode = "disable"
113
  etag.use-mtime = "disable"
114
  etag.use-size = "disable"
115
}
116
			   
117
fastcgi.server = (
118
    ".cgi"=>
119
    ((
120
        "socket"=>"/tmp/ability.fcgi.socket",
121
        #"port" => 1026,
122
        "check-local"=>"disable",
123
        "bin-path"=>"/bin/abfcgi",
124
        "max-procs" => 1,
125
        "allow-x-send-file" => "enable"
126
    )),
127
    "aiapp"=>
128
    ((
129
        "socket"=>"/tmp/abilitycalibration.fcgi.socket",
130
        "check-local"=>"disable",
131
        "bin-path"=>"/bin/ai_cgi_app",
132
        "max-procs" => 1,
133
        "allow-x-send-file" => "enable"
134
    ))
135
)
136

    
137
alias.url += (
138
        "/cgi-bin" 	=> "/usr/web/" + "/cgi-bin",
139
        "/axis-cgi" => "/usr/web/" + "/cgi-bin",
140
        "/css"     	=> "/usr/web/" + "/css",
141
        "/images"   => "/usr/web/" + "/images",
142
        "/js" 		=> "/usr/web/" + "/js",
143
        "/videos"   => "/usr/web/" + "/videos",
144
		"/websock"           => "/usr/web/" + "/websock"
145
)
146

    
147

    
148

    
149
cgi.assign = (
150
	#".cgi" => "",
151
	".py"  => "/usr/bin/python"
152
)
153
cgi.execute-all = "enable" 
154

    
155
#server.errorlog = "/var/log/lighttpd.error.log"
156
static-file.exclude-extensions = ( ".fcgi", ".php", ".rb", "~", ".inc", ".cgi", ".clb" )
157
index-file.names = ( "Welcome.html","AIDemo/index.html" )
158

    
159

    
160
#IPv6
161
#$SERVER["socket"] == "0.0.0.0:443" { <here your ssl options> }	
162
#$SERVER["socket"] == "[::]:443" { <here your ssl options again> }
(1-1/5)