Title: HTTPS issue with WordPress behind Application Load Balancer on AWS
Last modified: May 5, 2018

---

# HTTPS issue with WordPress behind Application Load Balancer on AWS

 *  [agrikk](https://wordpress.org/support/users/agrikk/)
 * (@agrikk)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/https-issue-with-wordpress-behind-application-load-balancer-on-aws/)
 * I am attempting to set up a wordpress site behind an application load balancer
   on AWS in which the certificate is installed on the ALB itself and not on the
   backing EC2 host. In effect, I am offloading the HTTPS traffic on the ALB and
   redirecting HTTPS traffic (443) to HTTP traffic (80) at the host.
 * As you can see by visiting [https://test.rainwalk.net](https://test.rainwalk.net)
   and [http://test.rainwalk.net](http://test.rainwalk.net) my wordpress configuration
   does not like this redirection.
 * Can anyone help me debug my config such that HTTPS to HTTP works?
 * The reason why I am doing it this way is that AWS offers free certificates through
   their Certificate Authority that secure their load balancers in a management-
   free way. I do not want to purchase and manage my own certificate to secure the
   Apache servers on the EC2 back-ends.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fhttps-issue-with-wordpress-behind-application-load-balancer-on-aws%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [wowpress.host](https://wordpress.org/support/users/wowpresshost/)
 * (@wowpresshost)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/https-issue-with-wordpress-behind-application-load-balancer-on-aws/#post-10252320)
 * Right now your http port is just not opened, make sure apache listens to port
   80 and http vhost is there.
 * But other than that you’ll need to make WordPress think he is on https so that
   it won’t issue redirects.
    One way to do that is to overwrite HTTPS=on and SERVER_PORT
   =443 server variables in your index.php / wp-config.php file.
 *  Thread Starter [agrikk](https://wordpress.org/support/users/agrikk/)
 * (@agrikk)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/https-issue-with-wordpress-behind-application-load-balancer-on-aws/#post-10268231)
 * > One way to do that is to overwrite HTTPS=on and SERVER_PORT=443 server variables
   > in your index.php / wp-config.php file.
 * I took a look at index.php and wp-config.php and the two variables you mentioned
   are not defined anywhere.
 * Can you please be more specific on how I “overwrite” these variables?
 *  [wowpress.host](https://wordpress.org/support/users/wowpresshost/)
 * (@wowpresshost)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/https-issue-with-wordpress-behind-application-load-balancer-on-aws/#post-10269384)
 *     ```
       $_SERVER['HTTPS'] = 'on';
       $_SERVER['SERVER_PORT'] = 443;
       ```
   
 * But.. well it’s better to understand what you are doing here, since it’s a kind
   of hack forcing most of PHP code think it is serving https request, while de-
   factro it’s not.
 *  Thread Starter [agrikk](https://wordpress.org/support/users/agrikk/)
 * (@agrikk)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/https-issue-with-wordpress-behind-application-load-balancer-on-aws/#post-10271471)
 * Thanks for the info.
 * Before I put in that hack, I changed my configuration so that I now have a CloudFront
   distribution answering [http://www.rainwalk.net](http://www.rainwalk.net) requests
   and is redirecting HTTP requests to HTTPS. It has the [http://www.rainwalk.net](http://www.rainwalk.net)
   cert installed for SSL traffic.
 * so it is Cloudfront <-> Load Balancer <-> EC2 instances
 * Why am I seeing the current behavior?
 * [https://www.rainwalk.net](https://www.rainwalk.net)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘HTTPS issue with WordPress behind Application Load Balancer on AWS’ is
closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [agrikk](https://wordpress.org/support/users/agrikk/)
 * Last activity: [8 years, 1 month ago](https://wordpress.org/support/topic/https-issue-with-wordpress-behind-application-load-balancer-on-aws/#post-10271471)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
