################################################################################################### #### Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. #### #### Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file #### except in compliance with the License. A copy of the License is located at #### #### http://aws.amazon.com/apache2.0/ #### #### or in the "license" file accompanying this file. This file is distributed on an "AS IS" #### BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the #### License for the specific language governing permissions and limitations under the License. ################################################################################################### ################################################################################################### #### This configuration file configures Apache for PHP environments to redirect HTTP requests on #### port 80 to HTTPS on port 443 after you have configured your environment to support HTTPS #### connections: #### #### Configuring Your Elastic Beanstalk Environment's Load Balancer to Terminate HTTPS: #### http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/configuring-https-elb.html #### #### Terminating HTTPS on EC2 Instances Running PHP: #### http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/https-singleinstance-php.html ################################################################################################### files: /etc/httpd/conf.d/http-redirect.conf: mode: "000644" owner: root group: root content: | RewriteEngine On RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteCond %{HTTP_USER_AGENT} !ELB-HealthChecker RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}