-
The server runs by reading the config.json configuration file, please make sure the server directory has this file
-
The configuration file config.json uses the json format to support // and /**/ as comments
-
bound port
-
If it is 0, it will be bound immediately
- html files accessed by default
- If you don't want to set it can be ""
-
Server operating mode
-
can only be "MULTIPLEXING" or "FORK" or "THREAD"
- bool type, whether to enable long connection
- bool type, whether to run in the background
- Whether to enable automatic restart when downtime
- whether to enable logging
- log storage path
- Whether to enable automatic path recognition
- bool type, whether to print the output to the terminal
- redirection, the structure is an array
"redirect":[
{"path":"/root","redirect":"https://baidu.com"},
{"path":"/temp","redirect":"./tem"}
],-
Manually exclude paths
-
is an array of strings
- replace path
"replace":[
{"path":"/root","repalce":"./template"},
{"path":"/temp*","repalce":"./tem"}
],-
Set up the proxy, and j load balancing, the structure is an array of objects
-
Each member includes three ingredients
-
The model mode can only be selected from RANDOM, HASH, POLLING, POLLRAN
random is random by weight
hash is assigned by hash
polling by weight
pollran polling plus random
-
path is the forwarding path, supports * matching
-
host is an array of servers, the format is ip:port
-
weight is the weight array, the number should be the same as the host, otherwise an error will occur
-
//set agent array
"reverse proxy":[
{"model":"RANDOM","path":"/try*","host":["127.0.0.1:5201"],"weight":[1]}
],- https cert location
- https key location
- key password (do not delete this line directly)
-
int type, no setting defaults to 1
-
The function is to set the initial send buffer size, the unit is M
-
Specify the number of threads, int type, the default is 5
-
Only works in THREAD mode