add toml config support

This commit is contained in:
Jun Kurihara 2022-06-27 15:07:29 -04:00
commit c3c95e9589
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03
10 changed files with 246 additions and 116 deletions

View file

@ -6,20 +6,20 @@
###################################
# Global settings #
###################################
http_port = 8080
https_port = 8443
# Both or either one of http/https ports must be specified
listen_port = 8080
listen_port_tls = 8443
###################################
# Backend settings #
###################################
[application]
[[application]]
app_name = 'localhost' # this should be option, if null then same as server_name
hostname = 'localhost'
https_redirection = true
[apps.localhost]
server_name = 'localhost'
reverse_proxy = [
# default destination if path is not specified
# TODO: Array for load balancing
# Array for load balancing
{ upstream = [
{ location = 'www.google.com', tls = true },
{ location = 'www.google.co.jp', tls = true },
@ -29,18 +29,13 @@ reverse_proxy = [
{ location = 'www.bing.co.jp', tls = true },
] },
]
tls = { https_redirection = true, tls_cert_path = 'localhost.pem', tls_cert_key_path = 'localhost.pem' }
## List of destinations to send data to.
## At this point, round-robin is used for load-balancing if multiple URLs are specified.
# allowhosts = ['127.0.0.1', '::1', '192.168.10.0/24'] # TODO
# denyhosts = ['*'] # TODO
tls_cert_path = 'localhost.pem'
tls_cert_key_path = 'localhost.pem'
[[application]]
app_name = 'locahost_application'
hostname = 'localhost.localdomain'
https_redirection = true
[apps.another_localhost]
server_name = 'localhost.localdomain'
reverse_proxy = [{ upstream = [{ location = 'www.google.com', tls = true }] }]
tls_cert_path = 'localhost.pem'
tls_cert_key_path = 'localhost.pem'