Redirect from Sentry

Hello everyone,

I have sentry installed on a Debian 10 server.

Sentry version: 9.1.2

When I load up sentry, I get redirected to it plain hostname instead of the FQDN.

I browse to https://sentry.example.com:49443 and I get redirected to https://sentry/auth/login

I am using nginx as a reverse proxy.

location  @sentry {

# headers
proxy_set_header      X-Forwarded-Host  $host;
proxy_set_header      X-Forwarded-Proto $scheme;
proxy_set_header      X-Forwarded-For   $proxy_add_x_forwarded_for;
proxy_set_header      X-Real-IP         $remote_addr;
proxy_redirect        off;

# timeouts
proxy_connect_timeout 300;
proxy_send_timeout    300;
proxy_read_timeout    300;
send_timeout          300;
proxy_cookie_path     / "/;secure;HttpOnly";

# caches
proxy_cache           static;
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;

# backend
proxy_pass            http://sentry;

}

Any thoughts on how to fix this redirect ?

Thanks!

Figured it out.

Changed the following
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header Host $http_host

Thanks!