Mikko Koivunalho
Mikko Koivunalho

Reputation: 341

Authenticate, Redirect to HTTPS and Rewrite url in Apache 2.4

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:

  1. Redirect all http calls to equivalent https address.
  2. Force authentication
  3. Rewrite/redirect to Waitress port

Upvotes: 0

Views: 496

Answers (1)

Capsule
Capsule

Reputation: 6159

  1. How to redirect all HTTP requests to HTTPS
  2. If your http server requests auth, it should be the case when rewritten too, but it will need to be handle on the Waitress side
  3. You already do that. To be more precise, you will need to add the rewrite rules from point 1 before your existing ones.

Upvotes: 1

Related Questions