Skip to content

Commit

Permalink
Wrangler: NGINX and redirects (#11305)
Browse files Browse the repository at this point in the history
Since we added `wrangler` to the equation this `$host` variable doesn't point
anymore to the `*.devthedocs.org` (documentation) domain anymore, and instead it
points to just `nginx`.

This is causing a problem in the redirects because our code checks
`X-Forwarded-Host` as the domain where the request is from.

```
proxito_1      | [info     ] Invalid domain.                [readthedocs.core.unresolver] domain=nginx host=nginx ip=10.10.0.100 request_id=e6dd83a5-66fb-4ead-9d0d-7f40a422c294 user_id=None
```

Note that `domain=nginx` and `host=nginx`.

By removing the override of this setting here, we are sending the real domain
from where the request was made, in my case `mystmd.devthedocs.org`.

This commit fixes the usage of redirects on local development.
  • Loading branch information
humitos committed Apr 25, 2024
1 parent 550e774 commit 3104ca3
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion dockerfiles/nginx/proxito.conf.template
Expand Up @@ -132,7 +132,6 @@ server {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
add_header X-Served Proxito-404-Fallback always;
}

Expand Down

0 comments on commit 3104ca3

Please sign in to comment.