update example config

This commit is contained in:
Jun Kurihara 2022-07-26 16:44:25 +09:00
commit 6365fe298f
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03
2 changed files with 29 additions and 23 deletions

View file

@ -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

View file

@ -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 #