Skip to content

Commit

Permalink
Revert "add cloud api proxy (#7948)" (#7975)
Browse files Browse the repository at this point in the history
This reverts commit 566f61b.
  • Loading branch information
mintsweet authored and d4x1 committed Sep 2, 2024
1 parent 36e2fd5 commit 4111e1e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
26 changes: 0 additions & 26 deletions config-ui/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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}";
Expand Down
2 changes: 1 addition & 1 deletion config-ui/nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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;'

0 comments on commit 4111e1e

Please sign in to comment.