From 0d285f5ff897bd0fd9f8e51d3522560cdf33dc67 Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Tue, 13 Dec 2022 11:17:47 -0600 Subject: [PATCH] Proxy for geth, ipld-eth-server, and lighthouse. --- config/keycloak/nginx/keycloak_proxy.conf | 38 +++++++++++++++++++++-- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/config/keycloak/nginx/keycloak_proxy.conf b/config/keycloak/nginx/keycloak_proxy.conf index c950c713..d6e5da05 100644 --- a/config/keycloak/nginx/keycloak_proxy.conf +++ b/config/keycloak/nginx/keycloak_proxy.conf @@ -8,14 +8,46 @@ server { root /usr/share/nginx/html; } - location ~ ^/v1/([^/]*)$ { - set $apiKey $1; + location ~ ^/eth/?([^/]*)$ { + set $apiKey $1; + if ($apiKey = '') { + set $apiKey $http_X_API_KEY; + } auth_request /auth; proxy_buffering off; rewrite /.*$ / break; proxy_pass http://fixturenet-eth-geth-1:8545; } - + + location ~ ^/ipld/eth/([^/]*)$ { + set $apiKey $1; + if ($apiKey = '') { + set $apiKey $http_X_API_KEY; + } + auth_request /auth; + proxy_buffering off; + rewrite /.*$ / break; + proxy_pass http://ipld-eth-server:8081; + } + + location ~ ^/ipld/gql/([^/]*)$ { + set $apiKey $1; + if ($apiKey = '') { + set $apiKey $http_X_API_KEY; + } + auth_request /auth; + proxy_buffering off; + rewrite /.*$ / break; + proxy_pass http://ipld-eth-server:8082; + } + + location /beacon/ { + set $apiKey $http_X_API_KEY; + auth_request /auth; + proxy_buffering off; + proxy_pass http://fixturenet-eth-lighthouse-1:8001/; + } + location = /auth { internal; proxy_buffering off;