Skip to content

Instantly share code, notes, and snippets.


Daniel van Flymen dvf

View GitHub Profile

Keybase proof

I hereby claim:

  • I am dvf on github.
  • I am dvf ( on keybase.
  • I have a public key ASAQIUnHg-9CdfTLGHPwrnal9t0rVtRrwrR272z-n25APAo

To claim this, I am signing this object:

dvf /
Created Feb 21, 2016 — forked from stephenash/
Django on ElasticBeanstalk - HTTP to HTTPS redirects

I needed a way to have my Django ElasticBeanstalk application automatically redirect HTTP requrests to HTTPS. Rick Christianson wrote a post [1] about how to do this by overwriting the wsgi.conf file with one that was slightly modified to support the HTTP to HTTPS redirect.

Building off the shoulders of giants, I wanted to do the same, but not have to keep a copy of the config file in my local source directory. Christianson even points out in his post that if ElasticBeanstalk ever changes it's template for the wsgi.conf file, those updates would not be overwritten and you wouldn't get their benefits. To get around that problem, I used sed to insert the new lines into the wsgi.conf file.