|
| 1 | +# http bind, if set port <= 0, will disable http server(need set https config) |
| 2 | +#port = 8080 |
| 3 | +#addr = "0.0.0.0" |
| 4 | + |
| 5 | +# directory to store static web files. if you use docker, please mount a persistence volume for it. |
| 6 | +file_dir = "./data/web" |
| 7 | + |
| 8 | +# enable cors, default is false, its implementation is simple now. |
| 9 | +# Access-Control-Allow-Origin: $ORIGIN |
| 10 | +# Access-Control-Allow-Methods: OPTION,GET,HEAD |
| 11 | +# Access-Control-Max-Age: 3600 |
| 12 | +cors = true |
| 13 | + |
| 14 | +# https config, optional |
| 15 | +https { |
| 16 | + // # default value for https ssl |
| 17 | + ssl { |
| 18 | + # private ssl key |
| 19 | + private = "./data/cert/local.fornetcode.com.key", |
| 20 | + # public ssl cert |
| 21 | + public = "./data/cert/local.fornetcode.com.cert" |
| 22 | + } |
| 23 | + |
| 24 | +// # https bind address |
| 25 | + port = 443 |
| 26 | + addr = "0.0.0.0" |
| 27 | + |
| 28 | + # if set true, http server(80) will send client |
| 29 | + # status code:301(Moved Permanently) to tell client redirect to https |
| 30 | + # optional, default is false |
| 31 | + http_redirect_to_https = true |
| 32 | +} |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | +# default cache config |
| 37 | +cache { |
| 38 | + # if file size > max_size, it will not be cached. default is (10MB). |
| 39 | + max_size = 1kb |
| 40 | + |
| 41 | + # http header Cache-Control config, |
| 42 | + # optional, if not set, won't sender this header to client |
| 43 | + client_cache = [{ |
| 44 | + expire = 30d |
| 45 | + extension_names = [icon,gif,jpg,jpeg,png,js] |
| 46 | + }, { |
| 47 | + // set 0, would set Cache-Control: no-cache |
| 48 | + expire = 0 |
| 49 | + extension_names = [html] |
| 50 | + }] |
| 51 | + |
| 52 | + # gzip compression for js/json/icon/json, default is false, |
| 53 | + # only support gzip algo, and only compress cached files, |
| 54 | + # be careful to set it true |
| 55 | + compression = true |
| 56 | + |
| 57 | +} |
| 58 | + |
| 59 | +# admin server config |
| 60 | +# admin server don't support hot reload. the config should not change. |
| 61 | +# optional, and it's disabled by default. |
| 62 | +# if you use spa-client to upload files, control version. Need to open it |
| 63 | +admin_config { |
| 64 | + # bind host |
| 65 | + port = 9000 |
| 66 | + addr = "127.0.0.1" |
| 67 | + |
| 68 | + # this is used to check client request |
| 69 | + # put it in http header, Authorization: Bearer $token |
| 70 | + token = "token" |
| 71 | + |
| 72 | +// # max file size allowed to be uploaded, |
| 73 | +// # default is 30MB(30*1024*1024) |
| 74 | +// max_upload_size = 31457280 |
| 75 | + |
| 76 | +// # delete deprecated version by cron |
| 77 | +// deprecated_version_delete { |
| 78 | +// # default value: every day at 3am. |
| 79 | +// cron: "0 0 3 * * *", |
| 80 | +// # default value is 2 |
| 81 | +// max_preserve: 2, |
| 82 | +// } |
| 83 | +} |
| 84 | + |
| 85 | + |
| 86 | +# optional, domains specfic config, it will use the default config if not set |
| 87 | +domains = [{ |
| 88 | + # domain name |
| 89 | + domain: "local.fornetcode.com", |
| 90 | + # optional, same with cache config, if not set, will use default cache config. |
| 91 | +// cache: { |
| 92 | +// client_cache:${cache.client_cache} |
| 93 | +// max_size: ${cache.max_size} |
| 94 | +// client_cache = ${cache.client_cache} |
| 95 | +// }, |
| 96 | + # cors |
| 97 | +// cors: true, |
| 98 | +// # domain https config, if not set, will use default https config. |
| 99 | +}] |
0 commit comments