http to https rerouting
HTTP to HTTPS routing
bvermeulen bvermeulen - posts: 156
Updated 6 years, 4 months ago by bvermeulen

HTTP to HTTPS re-routing

  1. log in to EC2 instance with SSH session (for example):

        ssh -i "{key_combination}.pem" ec2-user@{ec2 instance}.{area}.compute.amazonaws.com
    
  2. copy the contents of the wsgi.conf file in /etc/httpd/conf.d

  3. paste the contents to a local wsgi.conf file in the base directory of application (same folder as where there is manage.py)
  4. edit the local wsgi.conf file and add between tags VirtualHost:

        RewriteEngine On
        RewriteCond %{HTTP:X-Forwarded-Proto} =http
        RewriteRule . https://%{HTTP:Host}%{REQUEST_URI} [L,R=permanent]
    
  5. add the file {app_name}.config file in the .ebextensions folder with following content:

        container_commands
         01_wsgireplace
            command 'cp wsgi.conf ../wsgi.conf'
    
  6. deploy application

        eb deploy
    
http to https rerouting
some MD
bvermeulen bvermeulen - posts: 156
Updated 6 years, 5 months ago by bvermeulen

this will print

in bold
strike through