I have configured an AWS ELB to point to my Ubuntu Server running the Wordpress 3.2.1. Everything worked great on the server until I put it behind a load balancer.

I setup the load balancer to forward port 80 to port 80 and port 443 to port 80.

I setup my virtual hosts file to check for the headers from the elb:

> 
> RewriteEngine On  
> 
>  RewriteCond %{HTTP:X-Forwarded-Proto} !https  
> 
>  RewriteRule !/status <https://%>{SERVER\_NAME}%{REQUEST\_URI} [L,R]
> 
> 
> 

Now whenever I go to an https url I get this message: 

> 
> This webpage has a redirect loop  
> 
>  The webpage at <https://mywebsite.com/securepage/> has resulted in too many redirects
> 
> 
> 

As soon as I disable the wordpress https plugin  

(<http://wordpress.org/extend/plugins/wordpress-https/>)  

The pages work but are now full of mixed content. pages that should be https are no longer https.

As soon as I access the server directly instead of through the elb it works again.

Any ideas on how I could get this to work with an AWS ELB?