Skip to content

Commit

Permalink
Fix api routing again
Browse files Browse the repository at this point in the history
  • Loading branch information
Leland Garofalo authored and Leland Garofalo committed Aug 25, 2023
1 parent 2c2322e commit 8941d96
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions docker/tiller/templates/askdarcel-web.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,6 @@ server {
proxy_redirect off;
}

location ~ ^/api/v2/(.*)$ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;

# See https://forum.nginx.org/read.php?2,215830,215832#msg-215832
# nginx only resolves DNS for statically-configured domain names
# once on startup. Since the API is behind an ELB whose IPs may
# change, we must configure nginx to resolve DNS dynamically.
# To do this, we configure a DNS resolver here and use a variable
# rather than a literal URL when configuring the proxy below.
resolver <%= open('/etc/resolv.conf').read.match(/nameserver (.*)/)[1] rescue '8.8.8.8' %>;
resolver_timeout 5s;

set api_url <%= env_api_go_url.chomp '/' %>;
proxy_pass $api_url/api/$1$is_args$args;
proxy_redirect off;
}

location ~ ^/api/(.*)$ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand Down

0 comments on commit 8941d96

Please sign in to comment.