diff --git a/README.md b/README.md index 5314d80..d839ca9 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,6 @@ ![Build and Publish Docker](https://github.com/junkurihara/rust-rpxy/actions/workflows/docker_build_push.yml/badge.svg) ![ShiftLeft Scan](https://github.com/junkurihara/rust-rpxy/actions/workflows/shift_left.yml/badge.svg) - **WIP Project** ## Introduction diff --git a/config-example.toml b/config-example.toml index 4e26faf..8032962 100644 --- a/config-example.toml +++ b/config-example.toml @@ -29,39 +29,46 @@ default_app = 'another_localhost' ################################### # Backend settings # ################################### -[application] +[apps] +###################################################################### +## Registering a backend app served by a domain name "localhost" [apps.localhost] -server_name = 'localhost' -reverse_proxy = [ - # default destination if path is not specified - # Array for load balancing - { upstream = [ - { location = 'www.yahoo.com', tls = true }, - { location = 'www.yahoo.co.jp', tls = true }, - ], upstream_options = [ - "override_host", - ] }, - { path = '/maps', upstream = [ - { location = 'www.bing.com', tls = true }, - { location = 'www.bing.co.jp', tls = true }, - ], upstream_options = [ - "override_host", - "upgrade_insecure_requests", - ] }, -] +server_name = 'localhost' # Domain name + # Optional: TLS setting. if https_port is specified and tls is true above, this must be given. tls = { https_redirection = true, tls_cert_path = '/certs/localhost.crt', tls_cert_key_path = '/certs/localhost.key' } # for docker volume mounted certs #tls = { https_redirection = true, tls_cert_path = './localhost.crt', tls_cert_key_path = './localhost.key' } # for local - -## List of destinations to send data to. -## At this point, round-robin is used for load-balancing if multiple URLs are specified. +## TODO # allowhosts = ['127.0.0.1', '::1', '192.168.10.0/24'] # TODO # denyhosts = ['*'] # TODO + +# default destination if "path" is not specified +[[apps.localhost.reverse_proxy]] +# List of destinations to send data to. At this point, round-robin is used for load-balancing if multiple URLs are specified. +upstream = [ + { location = 'www.yahoo.com', tls = true }, + { location = 'www.yahoo.co.jp', tls = true }, +] +upstream_options = ["override_host"] + +# Non-default destination in "localhost" app, which is routed by "path" +[[apps.localhost.reverse_proxy]] +path = '/maps' +upstream = [ + { location = 'www.bing.com', tls = true }, + { location = 'www.bing.co.jp', tls = true }, +] +upstream_options = ["override_host", "upgrade_insecure_requests"] +###################################################################### + +###################################################################### +# Another application backend servied by different domain name [apps.another_localhost] server_name = 'localhost.localdomain' reverse_proxy = [{ upstream = [{ location = 'www.google.com', tls = true }] }] +###################################################################### ################################### # Experimantal settings #