2018-09-13 10:25:30 +00:00
|
|
|
/* This is a JSON format configuration file
|
|
|
|
*/
|
|
|
|
{
|
|
|
|
//ssl:the global ssl files setting
|
2018-10-14 03:53:05 +00:00
|
|
|
/*
|
2018-09-13 10:25:30 +00:00
|
|
|
"ssl": {
|
|
|
|
"cert": "../../trantor/trantor/tests/server.pem",
|
|
|
|
"key": "../../trantor/trantor/tests/server.pem"
|
|
|
|
},
|
|
|
|
"listeners": [
|
|
|
|
{
|
|
|
|
//address:ip address,0.0.0.0 by default
|
|
|
|
"address": "0.0.0.0",
|
|
|
|
//port:port number
|
|
|
|
"port": 80,
|
|
|
|
//https:if use https for security,false by default
|
|
|
|
"https": false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"address": "0.0.0.0",
|
|
|
|
"port": 443,
|
|
|
|
"https": true,
|
|
|
|
//cert,key:cert file path and key file path,empty by default,
|
|
|
|
//if empty,use global setting
|
|
|
|
"cert": "",
|
|
|
|
"key": ""
|
|
|
|
}
|
2018-10-14 03:53:05 +00:00
|
|
|
],*/
|
2018-11-12 05:39:22 +00:00
|
|
|
"db_clients":[
|
|
|
|
{
|
|
|
|
//name:Name of the client,'default' by default
|
|
|
|
//"name":"",
|
|
|
|
//rdbms:server type, "postgreSQL" by default
|
|
|
|
"rdbms": "postgreSQL",
|
|
|
|
//host:server address,localhost by default
|
|
|
|
"host": "127.0.0.1",
|
|
|
|
//port:server port, 5432 by default
|
|
|
|
"port": 5432,
|
|
|
|
//dbname:Database name
|
|
|
|
"dbname": "test",
|
|
|
|
//user:'postgres' by default
|
|
|
|
"user": "",
|
|
|
|
//passwd:'' by default
|
|
|
|
"passwd": "",
|
|
|
|
//connection_number:1 by default
|
|
|
|
"connection_number":1
|
|
|
|
}
|
|
|
|
],
|
2018-09-13 10:25:30 +00:00
|
|
|
"app": {
|
|
|
|
//threads_num:num of threads,1 by default
|
|
|
|
"threads_num": 16,
|
|
|
|
//enable_session:false by default
|
2018-10-25 10:07:29 +00:00
|
|
|
"enable_session": true,
|
|
|
|
"session_timeout": 1200,
|
2018-09-13 10:25:30 +00:00
|
|
|
//document_root:Root path of HTTP document,defaut path is ./
|
2018-10-14 03:53:05 +00:00
|
|
|
"document_root": "./",
|
2018-09-13 10:25:30 +00:00
|
|
|
/* file_types:
|
|
|
|
* HTTP download file types,The file types supported by drogon
|
|
|
|
* by default are "html", "js", "css", "xml", "xsl", "txt", "svg",
|
|
|
|
* "ttf", "otf", "woff2", "woff" , "eot", "png", "jpg", "jpeg",
|
|
|
|
* "gif", "bmp", "ico", "icns", etc. */
|
2018-10-14 03:53:05 +00:00
|
|
|
"file_types": [
|
|
|
|
"gif",
|
|
|
|
"png",
|
|
|
|
"jpg",
|
|
|
|
"js",
|
|
|
|
"css",
|
|
|
|
"html",
|
|
|
|
"ico",
|
|
|
|
"swf",
|
|
|
|
"xap",
|
|
|
|
"apk",
|
|
|
|
"cur",
|
|
|
|
"xml"
|
|
|
|
],
|
2018-09-13 10:25:30 +00:00
|
|
|
//max_connections:max connections number,100000 by default
|
2018-10-14 03:53:05 +00:00
|
|
|
"max_connections": 100000,
|
2018-09-29 07:30:27 +00:00
|
|
|
//max_connections_per_ip:max connections number per clinet,0 by default which means no limit
|
2018-10-14 03:53:05 +00:00
|
|
|
"max_connections_per_ip": 0,
|
2018-09-13 10:25:30 +00:00
|
|
|
//Load_dynamic_views: false by default, when set to true, drogon will
|
|
|
|
//compile and load dynamically "CSP View Files" in directories defined
|
|
|
|
//by "dynamic_views_path"
|
2018-10-08 10:44:23 +00:00
|
|
|
//"load_dynamic_views":true,
|
2018-09-16 03:50:29 +00:00
|
|
|
//dynamic_views_path: if the path isn't prefixed with / or ./,
|
|
|
|
//it will be relative path of document_root path
|
2018-10-08 10:44:23 +00:00
|
|
|
//"dynamic_views_path":["./views"],
|
2018-09-13 10:25:30 +00:00
|
|
|
//log:set log output,drogon output logs to stdout by default
|
2018-10-14 03:53:05 +00:00
|
|
|
"log": {
|
2018-09-13 10:25:30 +00:00
|
|
|
//log_path:log file path,empty by default,in which case,log will output to the stdout
|
2018-10-24 08:10:28 +00:00
|
|
|
//"log_path": "./",
|
2018-09-13 10:25:30 +00:00
|
|
|
//logfile_base_name:log file base name,empty by default which means drogon will name logfile as
|
|
|
|
//drogon.log ...
|
2018-10-14 03:53:05 +00:00
|
|
|
"logfile_base_name": "",
|
2018-09-13 10:25:30 +00:00
|
|
|
//log_size_limit:100000000 bytes by default,
|
2018-10-02 09:20:32 +00:00
|
|
|
//When the log file size reaches "log_size_limit", the log file will be switched.
|
2018-10-14 03:53:05 +00:00
|
|
|
"log_size_limit": 100000000,
|
2018-10-06 02:15:46 +00:00
|
|
|
//log_level:"DEBUG" by default,options:"TRACE","DEBUG","INFO","WARN"
|
|
|
|
//The TRACE level is only valid when built in DEBUG mode.
|
2018-10-24 08:10:28 +00:00
|
|
|
"log_level": "TRACE"
|
2018-09-13 10:25:30 +00:00
|
|
|
},
|
|
|
|
//run_as_daemon:false by default
|
2018-10-14 03:53:05 +00:00
|
|
|
"run_as_daemon": false,
|
2018-09-13 10:25:30 +00:00
|
|
|
//relaunch_on_error:false by default,if true,the program will be restart by parent after exit;
|
2018-10-14 03:53:05 +00:00
|
|
|
"relaunch_on_error": false,
|
2018-09-25 10:07:29 +00:00
|
|
|
//use_sendfile:true by default,if ture,the program will
|
|
|
|
//use sendfile() system-call to send static file to client;
|
2018-10-14 03:53:05 +00:00
|
|
|
"use_sendfile": true,
|
|
|
|
//use_gzip:true by default,use gzip to compress the response body's content;
|
2018-10-15 05:34:38 +00:00
|
|
|
"use_gzip": true,
|
|
|
|
//static_files_cache_time:5 by default,the time in which static file response is cached,
|
|
|
|
//0 means cache forever,the negative value means no cache
|
2018-10-21 06:52:41 +00:00
|
|
|
"static_files_cache_time": 5,
|
|
|
|
//simple_controllers_map:Configuring mapping from path to simple controller
|
|
|
|
"simple_controllers_map": [
|
|
|
|
{
|
|
|
|
"path": "/path/name",
|
|
|
|
"controller": "controllerClassName",
|
|
|
|
"http_methods": ["get","post"],
|
|
|
|
"filters": ["FilterClassName"]
|
|
|
|
}
|
2018-10-24 08:10:28 +00:00
|
|
|
],
|
|
|
|
//idle_connection_timeout: defaults to 60 seconds, the lifetime
|
|
|
|
//of the connection without read or write
|
2018-11-11 03:00:46 +00:00
|
|
|
"idle_connection_timeout":60
|
2018-09-13 10:25:30 +00:00
|
|
|
}
|
2018-10-24 08:10:28 +00:00
|
|
|
}
|