1- # http bind, if set port <= 0, will disable http server.
1+ # http bind, if set port <= 0, will disable http server(need set https config)
22port = 80
33addr = "0.0.0.0"
44
5- # directory to store static files.
5+ # directory to store static web files. if you use docker, please mount a persistence volume for it .
66file_dir = "/data"
77
88# enable cors, default is false, its implementation is simple now.
9- # Access-Control-Allow-Origin: *
9+ # Access-Control-Allow-Origin: $ORIGIN
1010# Access-Control-Allow-Methods: OPTION,GET,HEAD
1111# Access-Control-Max-Age: 3600
1212// cors = true
1313
1414# https config, optional
1515//https {
16- // # private ssl key
17- // private = "private.key path",
18- // # public ssl cert
19- // public = "public.cert path"
16+ // # default value for https ssl
17+ // ssl {
18+ // # private ssl key
19+ // private = "private.key path",
20+ // # public ssl cert
21+ // public = "public.cert path"
22+ // }
23+
24+ // # https bind address
2025// port = 443
2126// addr = "0.0.0.0"
22- // # if set true, http server(80) will send client 301(Moved Permanently) to https.
27+
28+ // # if set true, http server(80) will send client
29+ // # status code:301(Moved Permanently) to tell client redirect to https
2330// # optional, default is false
2431// http_redirect_to_https = false
25- // # gzip compression for js/json/icon/json, default is false,
26- // # only support gzip algo, only compress cached files,
27- // # will occur error when client don't support gzip
28- // # be careful to set it true
29- // compression = false
3032//}
3133
32- # cache config
34+
35+
36+ # default cache config
3337//cache {
3438// # if file size > max_size, it will not be cached. default is 10485760 (10MB).
35- // # do not use size unit format like 50m! It's blocked by [hocon #62](https://github.com/mockersf/hocon.rs/issues/62)
39+ // # do not use size unit format like 50MB!
40+ // # It's blocked by [hocon #62](https://github.com/mockersf/hocon.rs/issues/62)
3641// max_size = 10485760 //10MB 10*1024*1024
37- // # Cache-Control config, optional
42+
43+ // # http header Cache-Control config,
44+ // # optional, if not set, won't sender this header to client
3845// client_cache = [{
3946// expire = 30d
4047// extension_names = [icon,gif,jpg,jpeg,png,js]
@@ -43,14 +50,48 @@ file_dir = "/data"
4350// expire = 0
4451// extension_names = [html]
4552// }]
53+
54+ // # gzip compression for js/json/icon/json, default is false,
55+ // # only support gzip algo, and only compress cached files,
56+ // # be careful to set it true
57+ // compression = false
58+
4659//}
4760
48- # admin server config, optional, and it's disabled by default. hot reload don't support admin server reload. the config should not change.
61+ //# admin server config
62+ //# admin server don't support hot reload. the config should not change.
63+ //# optional, and it's disabled by default.
64+ //# if you use spa-client to upload files, control version. Need to open it
4965//admin_config {
66+ //# bind host
5067// port = 9000
5168// addr = "127.0.0.1"
52- // # this is used as auth check. In Header: Authorization: Bearer token
69+
70+ // # this is used to check client request
71+ // # put it in http header, Authorization: Bearer $token
5372// token = "token"
54- // # max file size allowed to be uploaded, default is 30MB(30*1024*1024)
73+
74+ // # max file size allowed to be uploaded,
75+ // # default is 30MB(30*1024*1024)
5576// max_upload_size = 31457280
5677//}
78+
79+
80+ # optional, domains specfic config, it will use the default config if not set
81+ //domains = [{
82+ // # domain name
83+ // domain: "www.example.com",
84+ // // optional, same with cache config, if not set, will use default cache config.
85+ // cache: {
86+ // client_cache:${cache.client_cache}
87+ // max_size: ${cache.max_size}
88+ // client_cache = ${cache.client_cache}
89+ // },
90+ // # cors
91+ // cors: ${cors},
92+ // # domain https config, if not set, will use default https config.
93+ // https: {
94+ // ssl: ${https.ssl}
95+ // http_redirect_to_https: ${https.http_redirect_to_https}
96+ // }
97+ //}]
0 commit comments