504 gateway timeout when trying to access /api/auth/login

I have setup Auth0 using the nextjs guide, and deployed my app via docker and nginx on a webserver. When I tested it in localhost it works, as I have set the AUTH0_BASE_URL to http://localhost:3000

However, when I deployed my web app and changed the base url to the url my website it deployed to, i get a 504 gateway timeout

[error] 19#19: *5 upstream timed out (110: Operation timed out) while reading response header from upstream, client: , server: https://, request: “GET /api/auth/login HTTP/2.0”, upstream: “”, host: “redacted”

Do I have to set the AUTH0_BASE_URL to instead?

seems like someone else faced the same issue but there was no reply