adding in some logic for sites served via proxies, this isn't a good permanent solution for the reasons outlined here http://esd.io/blog/flask-apps-heroku-real-ip-spoofing.html