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

Investigate potential redirect loop in reverse proxy setup #126

Open
hellais opened this issue Dec 16, 2024 · 0 comments
Open

Investigate potential redirect loop in reverse proxy setup #126

hellais opened this issue Dec 16, 2024 · 0 comments
Assignees

Comments

@hellais
Copy link
Member

hellais commented Dec 16, 2024

I noticed this while developing an alternative probe-services client and it's unclear if this is impact real probes, but we should probably look into it.

In order to reproduce the error you can run:

curl -vv -X POST https://backend-fsn.ooni.org/
< HTTP/2 463

or

curl -vv -X POST https://api.ooni.org/
< HTTP/2 463

The culprit here is the following nginx config inside of backend-fsn:

    # match test-helper POST to / and forward traffic to a TH
    if ($request_uri = "/") { set $forward_to_th "YE"; }
    if ($request_method = POST) { set $forward_to_th "${forward_to_th}S"; }
    if ($forward_to_th = "YES") {
      proxy_pass https://0.th.ooni.org;
    }

Which is a catch all for the POST method that redirects to 0.th.ooni.org, however since 0.th.ooni.org is pointing to the ALB instance which matches on the Host header, it will end up into a redirect loop.

It's tempting to just override the Host header in the catch all rule, but the impact of that change is also uncertain.

We should see if we can notice anything unusual in the collected metrics and if so make some attempts at changing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Sprint Backlog
Development

No branches or pull requests

2 participants