I am running a Python http server (Waitress) behind an Apache 2.4 web server. I have a rewrite rule to make Apache actually access an internal port (55555) in my system (the port that Waitress serves). This works well. Waitress cannot serve HTTPS.
But now I need two more things: force users to always use HTTPS and authenticate users with Apache's own AuthType Basic. Is it possible to have all these three things together? This "double redirection"!
Should happen in this order:
- Redirect all http calls to equivalent https address.
- Force authentication
- Rewrite/redirect to Waitress port