Implicit https for apache redirects when using AWS ELB to terminate SSL

65 Views Asked by At

I have an autoscaling application, which uses an ELB to terminate SSL, and forward 443 requests to http 80 on the instances.

This works fine, except that if I do a redirect within apache, it implicitly uses http rather than https.

for example, I have the following rewrite rule...

RewriteRule    ^/v10/(.*) /v11/$1 [R]

If I do the following...

curl -v "https://[mydomain.com]/v10/somescript.js"

I get a 302 response like this...

Location: http://[mydomain.com]/v11/somescript.js

... which then breaks my application, as the browser won't load the script via http.

Of course this makes sense, since as far as apache is concerned, it is http. However aside from re-writing all my redirect rules, I'm wondering if there is some way to convince apache to implicitly generate https redirects, even though it isn't terminating the SSL?

0

There are 0 best solutions below