From 30f8c58cab859d5fca2ed0c22c2d61d0b4c8eadf Mon Sep 17 00:00:00 2001 From: mintsweet <0x1304570@gmail.com> Date: Wed, 28 Aug 2024 19:38:44 +1200 Subject: [PATCH] Revert "add cloud api proxy (#7948)" This reverts commit 566f61bcebd262c1ddd8aef304da32f268c64da8. --- config-ui/nginx.conf | 26 -------------------------- config-ui/nginx.sh | 2 +- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/config-ui/nginx.conf b/config-ui/nginx.conf index 7d810010a64..959d8bff802 100644 --- a/config-ui/nginx.conf +++ b/config-ui/nginx.conf @@ -22,13 +22,9 @@ ${SERVER_CONF} resolver ${DNS} valid=${DNS_VALID}; resolver_timeout 3s; set $target "${DEVLAKE_ENDPOINT}"; - - #https://serverfault.com/questions/459369/disabling-url-decoding-in-nginx-proxy rewrite ^ $request_uri; rewrite ^/api/(.*) $1 break; - # If the second rewrite rule doesn't match, return 400 return 400; - proxy_send_timeout 60s; proxy_read_timeout 60s; proxy_pass ${DEVLAKE_ENDPOINT_PROTO}://$target/$uri; @@ -49,28 +45,6 @@ ${SERVER_CONF} proxy_set_header "Connection" ""; } - location /cloud-api/ { - resolver ${DNS} valid=${DNS_VALID}; - resolver_timeout 3s; - - set $target "${DEVLAKE_CLOUD_API}"; - if ($target = "") { - return 503; - } - - #https://serverfault.com/questions/459369/disabling-url-decoding-in-nginx-proxy - rewrite ^ $request_uri; - rewrite ^/cloud-api/(.*) $1 break; - # If the second rewrite rule doesn't match, return 400 - return 400; - - proxy_send_timeout 60s; - proxy_read_timeout 60s; - proxy_pass $target/$uri; - proxy_http_version 1.1; - proxy_set_header "Connection" ""; - } - location /grafana/ { auth_basic off; set $external "${USE_EXTERNAL_GRAFANA}"; diff --git a/config-ui/nginx.sh b/config-ui/nginx.sh index e35587a6477..3e216b45146 100755 --- a/config-ui/nginx.sh +++ b/config-ui/nginx.sh @@ -45,7 +45,7 @@ export DNS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {if ($2 ~ ":") {print "["$2"]" export DNS_VALID=${DNS_VALID:-300s} export DEVLAKE_ENDPOINT_PROTO=${DEVLAKE_ENDPOINT_PROTO:-http} export GRAFANA_ENDPOINT_PROTO=${GRAFANA_ENDPOINT_PROTO:-http} -envsubst '${LISTENER} ${DEVLAKE_ENDPOINT} ${DEVLAKE_ENDPOINT_PROTO} ${DEVLAKE_CLOUD_API} ${GRAFANA_ENDPOINT} ${GRAFANA_ENDPOINT_PROTO} ${USE_EXTERNAL_GRAFANA} ${SERVER_CONF} ${DNS} ${DNS_VALID}' \ +envsubst '${LISTENER} ${DEVLAKE_ENDPOINT} ${DEVLAKE_ENDPOINT_PROTO} ${GRAFANA_ENDPOINT} ${GRAFANA_ENDPOINT_PROTO} ${USE_EXTERNAL_GRAFANA} ${SERVER_CONF} ${DNS} ${DNS_VALID}' \ < /etc/nginx/conf.d/default.conf.tpl \ > /etc/nginx/conf.d/default.conf nginx -g 'daemon off;'