Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refine and add more configuration in the examples/config.toml #134

Merged
merged 1 commit into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 26 additions & 8 deletions examples/config.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
[runtime]
# runtime_type = "legacy"
runtime_type = "io_uring"
worker_threads = 2
entries = 1024

[servers.demo_basic]
name = "gateway.monolake.rs"
listener = { type = "socket", value = "0.0.0.0:8080" }
upstream_http_version = "http2"
upstream_http_version = "http11"
http_opt_handlers = { content_handler = true }

# front-end HTTP, back-end HTTP
[[servers.demo_basic.routes]]
path = '/'
upstreams = [{ endpoint = { type = "uri", value = "https://www.bytedance.com/" } }]
upstreams = [{ endpoint = { type = "uri", value = "http://ifconfig.me/" } }]

# front-end HTTP, back-end HTTPS
[[servers.demo_basic.routes]]
path = '/github'
upstreams = [{ endpoint = { type = "uri", value = "https://github.com/" } }]
path = '/example'
upstreams = [{ endpoint = { type = "uri", value = "https://example.com/" } }]


[servers.demo_tls]
Expand Down Expand Up @@ -58,10 +60,18 @@ tls = { chain = "examples/certs/server.crt", key = "examples/certs/server.key",
name = "gateway.monolake.rs"
listener = { type = "socket", value = "0.0.0.0:8082" }

# front-end HTTPS, back-end HTTP
[[servers.demo_rustls.routes]]
path = '/'
upstreams = [
{ endpoint = { type = "uri", value = "https://www.wikipedia.org" } },
{ endpoint = { type = "uri", value = "http://ifconfig.me" } },
]

# front-end HTTPS, back-end HTTPS
[[servers.demo_rustls.routes]]
path = '/example'
upstreams = [
{ endpoint = { type = "uri", value = "https://example.com" } },
]


Expand All @@ -70,11 +80,19 @@ tls = { chain = "examples/certs/server.crt", key = "examples/certs/server.key",
name = "gateway.monolake.rs"
listener = { type = "socket", value = "0.0.0.0:8083" }

# front-end HTTPS, back-end HTTP
[[servers.demo_native_tls.routes]]
path = '/'
upstreams = [
{ endpoint = { type = "uri", value = "https://www.wikipedia.org" } },
{ endpoint = { type = "uri", value = "http://ifconfig.me" } },
]

# front-end HTTPS, back-end HTTPS
[[servers.demo_native_tls.routes]]
path = '/example'
upstreams = [
{ endpoint = { type = "uri", value = "https://example.com" } },
]
path = '/'


[servers.demo_timeout]
Expand Down
2 changes: 1 addition & 1 deletion examples/gen_cert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ openssl x509 -req -sha512 -days 3650 \
-out server.crt

# Convert files
rm rootCA.srl server.csr v3.ext
rm -f rootCA.srl server.csr v3.ext
openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in server.key -out server.pkcs8
Loading