I have a site running on google app engine with a private dns.
But every time I open that website it opens as http, I tried using a before_request decorator on flask to change http to https but I get too_many_redirects error, I also tried using ProxyFix but since my page don't have X-Forwarded-Proto as a header it doesn't redirect to the correct page.
EDIT: I forgot to mention that I'm using a flex environment
What is the best way to configure this behavior? Where can I set this configuration and if possible how can I set it?
This is how I was trying to redirect:
@app.before_request
def before_request():
if request.endpoint in app.view_functions and request.headers.get('X-Forwarded-Proto', None) == 'http':
code = 301
return redirect(request.url.replace('http://', 'https://'), code=code)
Thx very much for the help!