Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix api routing again #1293

Merged
merged 1 commit into from
Aug 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading