I have a Flask server running on a Windows EC2 instance.
I need to have it using https protocol, so my setup is like this :
- I have a Caddy server
- I use Waitress to run my flask app
Here is my config for Caddy :
example.com:443{
proxy / 127.0.0.1:8080
tls me@example.com
}
Everything is working fine excepted that in my application.py file, when I do :
return redirect(url_for('test', filename=filename))
My web browser redirect me :
Same result with _external=True
But on a template page, for example https://example.com/test2 rendered using render_template( "test2.html") if I have a link <a href="{{ url_for('index') }}" /> the HTML generated is well : https://example.com/
For now I have hard coded my url in application.py but this is not the way that I would like to keep it...