From 500815fb1e7d0d369c16069612c5d30ace5fbb6a Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Mon, 22 Apr 2024 18:02:52 -0500 Subject: [PATCH] Host ts-nitro example site through Caddy --- .../data/compose/docker-compose-nitro-auth.yml | 3 +-- stack_orchestrator/data/config/nitro-auth/bob.env | 2 ++ stack_orchestrator/data/config/nitro-auth/caddy/Caddyfile | 8 +++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/stack_orchestrator/data/compose/docker-compose-nitro-auth.yml b/stack_orchestrator/data/compose/docker-compose-nitro-auth.yml index 2449a524..151a8336 100644 --- a/stack_orchestrator/data/compose/docker-compose-nitro-auth.yml +++ b/stack_orchestrator/data/compose/docker-compose-nitro-auth.yml @@ -81,6 +81,7 @@ services: CERC_CA_ADDRESS: ${CERC_CA_ADDRESS} CERC_NITRO_TARGET_URL: ${CERC_NITRO_TARGET_URL:-http://localhost:5678} CERC_RUNTIME_ENV_RPC_URL: ${CERC_RUNTIME_ENV_RPC_URL:-ws://localhost:8546} + PUBLIC_URL: http://localhost:5678/ts-nitro env_file: - ../config/nitro-auth/charlie.env entrypoint: ["bash", "-c", "/app/run.sh"] @@ -93,8 +94,6 @@ services: timeout: 5s retries: 100 start_period: 100s - ports: - - "3000" go-nitro-bootnode: image: cerc/go-nitro:local diff --git a/stack_orchestrator/data/config/nitro-auth/bob.env b/stack_orchestrator/data/config/nitro-auth/bob.env index fc280b54..056a5c17 100644 --- a/stack_orchestrator/data/config/nitro-auth/bob.env +++ b/stack_orchestrator/data/config/nitro-auth/bob.env @@ -17,3 +17,5 @@ CERC_NITRO_RPC_PORT=4007 CERC_NITRO_UI_PORT=4107 CERC_NITRO_USE_DURABLE_STORE=true CERC_NITRO_WS_MSG_PORT=5007 +CERC_NITRO_MSG_PUBLIC_IP=127.0.0.1 +CERC_NITRO_MSG_PUBLIC_PORT=5007 diff --git a/stack_orchestrator/data/config/nitro-auth/caddy/Caddyfile b/stack_orchestrator/data/config/nitro-auth/caddy/Caddyfile index 13a11607..04c80691 100644 --- a/stack_orchestrator/data/config/nitro-auth/caddy/Caddyfile +++ b/stack_orchestrator/data/config/nitro-auth/caddy/Caddyfile @@ -15,6 +15,7 @@ rewrite * / reverse_proxy {$CERC_ETH_RPC_ENDPOINT} { header_up Host {upstream_hostport} + header_up -X-Forwarded-* } } @@ -29,6 +30,7 @@ rewrite * / reverse_proxy {$CERC_ETH_RPC_ENDPOINT} { header_up Host {upstream_hostport} + header_up -X-Forwarded-* } } @@ -36,7 +38,11 @@ respond "401 Unauthorized" 401 } + handle /ts-nitro* { + reverse_proxy http://ts-nitro-charlie:3000 + } + handle { reverse_proxy http://go-nitro-alice:4206 } -} \ No newline at end of file +}