Advertisement
rajhlinux

Untitled

Mar 6th, 2023
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.41 KB | None | 0 0
  1. /* This is a JSON format configuration file */
  2. {
  3.  
  4. //ssl:The global SSL settings. "key" and "cert" are the path to the SSL key and certificate. While
  5. // "conf" is an array of 1 or 2-element tuples that supplies file style options for `SSL_CONF_cmd`.
  6.  
  7. "ssl":
  8. {
  9. "cert": "/usr/local/etc/letsencrypt/live/shopperplug.com/fullchain.pem",
  10. "key": "/usr/local/etc/letsencrypt/live/shopperplug.com/privkey.pem"
  11.  
  12. // "conf":
  13. // [
  14. // //["Options", "-SessionTicket"],
  15. // //["Options", "Compression"]
  16. // ]
  17. },
  18.  
  19. "listeners":
  20. [
  21.  
  22. {
  23. //address: Ip address,0.0.0.0 by default
  24. "address": "0.0.0.0",
  25.  
  26. //port: Port number
  27. "port": 80,
  28.  
  29. //https: If true, use https for security,false by default
  30. "https": true
  31. },
  32.  
  33. {
  34. "address": "0.0.0.0",
  35. "port": 443,
  36. "https": true,
  37.  
  38. //cert,key: Cert file path and key file path, empty by default, if empty, use the global setting
  39. "cert": "",
  40. "key": "",
  41.  
  42. //use_old_tls: enable the TLS1.0/1.1, false by default
  43. "use_old_tls": false
  44.  
  45. // "ssl_conf":
  46. // [
  47. // //["MinProtocol", "TLSv1.3"]
  48. // ]
  49. }
  50. ],
  51.  
  52. /*
  53. "db_clients": [
  54. {
  55. //name: Name of the client,'default' by default
  56. //"name":"",
  57. //rdbms: Server type, postgresql,mysql or sqlite3, "postgresql" by default
  58. "rdbms": "postgresql",
  59. //filename: Sqlite3 db file name
  60. //"filename":"",
  61. //host: Server address,localhost by default
  62. "host": "127.0.0.1",
  63. //port: Server port, 5432 by default
  64. "port": 5432,
  65. //dbname: Database name
  66. "dbname": "test",
  67. //user: 'postgres' by default
  68. "user": "",
  69. //passwd: '' by default
  70. "passwd": "",
  71. //is_fast: false by default, if it is true, the client is faster but user can't call
  72. //any synchronous interface of it.
  73. "is_fast": false,
  74. //client_encoding: The character set used by the client. it is empty string by default which
  75. //means use the default character set.
  76. //"client_encoding": "",
  77. //number_of_connections: 1 by default, if the 'is_fast' is true, the number is the number of
  78. //connections per IO thread, otherwise it is the total number of all connections.
  79. "number_of_connections": 1,
  80. //timeout: -1.0 by default, in seconds, the timeout for executing a SQL query.
  81. //zero or negative value means no timeout.
  82. "timeout": -1.0,
  83. //"auto_batch": this feature is only available for the PostgreSQL driver(version >= 14.0), see
  84. // the wiki for more details.
  85. "auto_batch": false
  86. }
  87. ],
  88. "redis_clients": [
  89. {
  90. //name: Name of the client,'default' by default
  91. //"name":"",
  92. //host: Server IP, 127.0.0.1 by default
  93. "host": "127.0.0.1",
  94. //port: Server port, 6379 by default
  95. "port": 6379,
  96. //username: '' by default which means 'default' in redis ACL
  97. "username": "",
  98. //passwd: '' by default
  99. "passwd": "",
  100. //db index: 0 by default
  101. "db": 0,
  102. //is_fast: false by default, if it is true, the client is faster but user can't call
  103. //any synchronous interface of it.
  104. "is_fast": false,
  105. //number_of_connections: 1 by default, if the 'is_fast' is true, the number is the number of
  106. //connections per IO thread, otherwise it is the total number of all connections.
  107. "number_of_connections": 1,
  108. //timeout: -1.0 by default, in seconds, the timeout for executing a command.
  109. //zero or negative value means no timeout.
  110. "timeout": -1.0
  111. }
  112. ],*/
  113. "app": {
  114. //number_of_threads: The number of IO threads, 1 by default, if the value is set to 0, the number of threads
  115. //is the number of CPU cores
  116. "number_of_threads": 1,
  117. //enable_session: False by default
  118. "enable_session": false,
  119. "session_timeout": 0,
  120. //string value of SameSite attribute of the Set-Cookie HTTP respone header
  121. //valid value is either 'Null' (default), 'Lax', 'Strict' or 'None'
  122. "session_same_site" : "Null",
  123. //document_root: Root path of HTTP document, defaut path is ./
  124. "document_root": "./",
  125. //home_page: Set the HTML file of the home page, the default value is "index.html"
  126. //If there isn't any handler registered to the path "/", the home page file in the "document_root" is send to clients as a response
  127. //to the request for "/".
  128. "home_page": "index.html",
  129. //use_implicit_page: enable implicit pages if true, true by default
  130. "use_implicit_page": true,
  131. //implicit_page: Set the file which would the server access in a directory that a user accessed.
  132. //For example, by default, http://localhost/a-directory resolves to http://localhost/a-directory/index.html.
  133. "implicit_page": "index.html",
  134. //static_file_headers: Headers for static files
  135. /*"static_file_headers": [
  136. {
  137. "name": "field-name",
  138. "value": "field-value"
  139. }
  140. ],*/
  141. //upload_path: The path to save the uploaded file. "uploads" by default.
  142. //If the path isn't prefixed with /, ./ or ../,
  143. //it is relative path of document_root path
  144. "upload_path": "uploads",
  145. /* file_types:
  146. * HTTP download file types,The file types supported by drogon
  147. * by default are "html", "js", "css", "xml", "xsl", "txt", "svg",
  148. * "ttf", "otf", "woff2", "woff" , "eot", "png", "jpg", "jpeg",
  149. * "gif", "bmp", "ico", "icns", etc. */
  150. "file_types": [
  151. "gif",
  152. "png",
  153. "jpg",
  154. "js",
  155. "css",
  156. "html",
  157. "svg",
  158. "ttf",
  159. "ico",
  160. "swf",
  161. "xap",
  162. "apk",
  163. "cur",
  164. "xml"
  165. ],
  166. // mime: A dictionary that extends the internal MIME type support. Maps extensions into new MIME types
  167. // note: This option only adds MIME to the sever. `file_types` above have to be set for the server to serve them.
  168. "mime": {
  169. // "text/markdown": "md",
  170. // "text/gemini": ["gmi", "gemini"]
  171. },
  172. //locations: An array of locations of static files for GET requests.
  173. "locations": [
  174. {
  175. //uri_prefix: The URI prefix of the location prefixed with "/", the default value is "" that disables the location.
  176. "uri_prefix": "/.well-known/acme-challenge/",
  177. //default_content_type: The default content type of the static files without
  178. //an extension. empty string by default.
  179. "default_content_type": "text/plain",
  180. //alias: The location in file system, if it is prefixed with "/", it
  181. //presents an absolute path, otherwise it presents a relative path to
  182. //the document_root path.
  183. //The default value is "" which means use the document root path as the location base path.
  184. "alias": "",
  185. //is_case_sensitive: indicates whether the URI prefix is case sensitive.
  186. "is_case_sensitive": false,
  187. //allow_all: true by default. If it is set to false, only static files with a valid extension can be accessed.
  188. "allow_all": true,
  189. //is_recursive: true by default. If it is set to false, files in sub directories can't be accessed.
  190. "is_recursive": true,
  191. //filters: string array, the filters applied to the location.
  192. "filters": []
  193. }
  194. ],
  195. //max_connections: maximum number of connections, 100000 by default
  196. "max_connections": 100000,
  197. //max_connections_per_ip: maximum number of connections per clinet, 0 by default which means no limit
  198. "max_connections_per_ip": 0,
  199. //Load_dynamic_views: False by default, when set to true, drogon
  200. //compiles and loads dynamically "CSP View Files" in directories defined
  201. //by "dynamic_views_path"
  202. "load_dynamic_views": false,
  203. //dynamic_views_path: If the path isn't prefixed with /, ./ or ../,
  204. //it is relative path of document_root path
  205. "dynamic_views_path": [
  206. "./views"
  207. ],
  208. //dynamic_views_output_path: Default by an empty string which means the output path of source
  209. //files is the path where the csp files locate. If the path isn't prefixed with /, it is relative
  210. //path of the current working directory.
  211. "dynamic_views_output_path": "",
  212. //enable_unicode_escaping_in_json: true by default, enable unicode escaping in json.
  213. "enable_unicode_escaping_in_json": true,
  214. //float_precision_in_json: set precision of float number in json.
  215. "float_precision_in_json": {
  216. //precision: 0 by default, 0 means use the default precision of the jsoncpp lib.
  217. "precision": 0,
  218. //precision_type: must be "significant" or "decimal", defaults to "significant" that means
  219. //setting max number of significant digits in string, "decimal" means setting max number of
  220. //digits after "." in string
  221. "precision_type": "significant"
  222. },
  223. //log: Set log output, drogon output logs to stdout by default
  224. "log": {
  225. //log_path: Log file path,empty by default,in which case,logs are output to the stdout
  226. //"log_path": "./",
  227. //logfile_base_name: Log file base name,empty by default which means drogon names logfile as
  228. //drogon.log ...
  229. "logfile_base_name": "",
  230. //log_size_limit: 100000000 bytes by default,
  231. //When the log file size reaches "log_size_limit", the log file is switched.
  232. "log_size_limit": 100000000,
  233. //log_level: "DEBUG" by default,options:"TRACE","DEBUG","INFO","WARN"
  234. //The TRACE level is only valid when built in DEBUG mode.
  235. "log_level": "DEBUG",
  236. //display_local_time: false by default, if true, the log time is displayed in local time
  237. "display_local_time": false
  238. },
  239. //run_as_daemon: False by default
  240. "run_as_daemon": false,
  241. //handle_sig_term: True by default
  242. "handle_sig_term": true,
  243. //relaunch_on_error: False by default, if true, the program will be restart by the parent after exiting;
  244. "relaunch_on_error": false,
  245. //use_sendfile: True by default, if true, the program
  246. //uses sendfile() system-call to send static files to clients;
  247. "use_sendfile": true,
  248. //use_gzip: True by default, use gzip to compress the response body's content;
  249. "use_gzip": true,
  250. //use_brotli: False by default, use brotli to compress the response body's content;
  251. "use_brotli": false,
  252. //static_files_cache_time: 5 (seconds) by default, the time in which the static file response is cached,
  253. //0 means cache forever, the negative value means no cache
  254. "static_files_cache_time": 5,
  255. //simple_controllers_map: Used to configure mapping from path to simple controller
  256.  
  257. // "simple_controllers_map": [
  258. // {
  259. // "path": "/path/name",
  260. // "controller": "controllerClassName",
  261. // "http_methods": [
  262. // "get",
  263. // "post"
  264. // ],
  265. // "filters": [
  266. // "FilterClassName"
  267. // ]
  268. // }
  269. // ],
  270.  
  271. //idle_connection_timeout: Defaults to 60 seconds, the lifetime
  272. //of the connection without read or write
  273. "idle_connection_timeout": 60,
  274. //server_header_field: Set the 'Server' header field in each response sent by drogon,
  275. //empty string by default with which the 'Server' header field is set to "Server: drogon/version string\r\n"
  276. "server_header_field": "",
  277. //enable_server_header: Set true to force drogon to add a 'Server' header to each HTTP response. The default
  278. //value is true.
  279. "enable_server_header": true,
  280. //enable_date_header: Set true to force drogon to add a 'Date' header to each HTTP response. The default
  281. //value is true.
  282. "enable_date_header": true,
  283. //keepalive_requests: Set the maximum number of requests that can be served through one keep-alive connection.
  284. //After the maximum number of requests are made, the connection is closed.
  285. //The default value of 0 means no limit.
  286. "keepalive_requests": 0,
  287. //pipelining_requests: Set the maximum number of unhandled requests that can be cached in pipelining buffer.
  288. //After the maximum number of requests are made, the connection is closed.
  289. //The default value of 0 means no limit.
  290. "pipelining_requests": 0,
  291. //gzip_static: If it is set to true, when the client requests a static file, drogon first finds the compressed
  292. //file with the extension ".gz" in the same path and send the compressed file to the client.
  293. //The default value of gzip_static is true.
  294. "gzip_static": true,
  295. //br_static: If it is set to true, when the client requests a static file, drogon first finds the compressed
  296. //file with the extension ".br" in the same path and send the compressed file to the client.
  297. //The default value of br_static is true.
  298. "br_static": true,
  299. //client_max_body_size: Set the maximum body size of HTTP requests received by drogon. The default value is "1M".
  300. //One can set it to "1024", "1k", "10M", "1G", etc. Setting it to "" means no limit.
  301. "client_max_body_size": "1M",
  302. //max_memory_body_size: Set the maximum body size in memory of HTTP requests received by drogon. The default value is "64K" bytes.
  303. //If the body size of a HTTP request exceeds this limit, the body is stored to a temporary file for processing.
  304. //Setting it to "" means no limit.
  305. "client_max_memory_body_size": "64K",
  306. //client_max_websocket_message_size: Set the maximum size of messages sent by WebSocket client. The default value is "128K".
  307. //One can set it to "1024", "1k", "10M", "1G", etc. Setting it to "" means no limit.
  308. "client_max_websocket_message_size": "128K",
  309. //reuse_port: Defaults to false, users can run multiple processes listening on the same port at the same time.
  310. "reuse_port": false,
  311. // enabled_compresed_request: Defaults to false. If true the server will automatically decompress compressed request bodies.
  312. // Currently only gzip and br are supported. Note: max_memory_body_size and max_body_size applies twice for compressed requests.
  313. // Once when receiving and once when decompressing. i.e. if the decompressed body is larger than max_body_size, the request
  314. // will be rejected.
  315. "enabled_compresed_request": false
  316. },
  317. //plugins: Define all plugins running in the application
  318. "plugins": [
  319. {
  320. //name: The class name of the plugin
  321. //"name": "drogon::plugin::SecureSSLRedirector",
  322. //dependencies: Plugins that the plugin depends on. It can be commented out
  323. "dependencies": [],
  324. //config: The configuration of the plugin. This json object is the parameter to initialize the plugin.
  325. //It can be commented out
  326. "config": {
  327. "ssl_redirect_exempt": [
  328. ".*\\.jpg"
  329. ],
  330. "secure_ssl_host": "localhost:8849"
  331. }
  332. }
  333. ],
  334. //custom_config: custom configuration for users. This object can be get by the app().getCustomConfig() method.
  335. "custom_config": {}
  336. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement