R
Railway11mo ago
kirby81

Gunicorn + Flask (ERR_TOO_MANY_REDIRECTS):

project_id: 51e075bf-103a-45f2-b2bf-41354422cbfd Hi there, I've got a Flask app serves by Gunicorn. The start command is this one: gunicorn --limit-request-line=15000 --worker-class=gevent manage:app But when I try to access it via the Railway public domain I've got ERR_TOO_MANY_REDIRECTS. Any clue on this ?
Solution:
Just to give you some updates on this: I manage to resolve this problem by putting --forwarded-allow-ips="*" option within the Gunicorn launch command. Here is the doc....
Jump to solution
7 Replies
Percy
Percy11mo ago
Project ID: 51e075bf-103a-45f2-b2bf-41354422cbfd
Floris
Floris11mo ago
this probably sounds like a code issue? when your code accidently loops redirects could you show me the python code that's responsible for ur endpoint
Brody
Brody11mo ago
yeah I've seen this before, it's your code trying to redirect to a non https url and then railway redirecting you back to https, and so on.
kirby81
kirby8111mo ago
My route is simple as that !
No description
Brody
Brody11mo ago
your own code that you wrote is not sending the redirect, it would be the framework for example, maybe the framework is redirecting non trailing slash routes to routes with trailing slashes, and in doing so is redirecting to a location without https maybe there is a way to tell gunicorn / flask to trust the proxy so that it knows the incoming requests are made with https definitely look into that
Solution
kirby81
kirby8111mo ago
Just to give you some updates on this: I manage to resolve this problem by putting --forwarded-allow-ips="*" option within the Gunicorn launch command. Here is the doc.
Brody
Brody11mo ago
perfect, that's exactly what I was getting at
Want results from more Discord servers?
Add your server