Skip to content

Instantly share code, notes, and snippets.

View chacken's full-sized avatar

Chris Hacken chacken

View GitHub Profile
@chacken
chacken / gist:5931348
Created July 5, 2013 02:49
Nginx http and www to https redirects example.
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
wget http://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx-signing.key
echo "deb http://nginx.org/packages/ubuntu/ precise nginx" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://nginx.org/packages/ubuntu/ precise nginx" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install nginx
pip install uwsgi
[uwsgi]
socket = 127.0.0.1:5000
module = app
callable = app
processes = 1
stats = 127.0.0.1:9191
import os
from tier import create_app
app = create_app('../config/production.py')
port = int(os.environ.get("PORT", 5000))
if __name__ == '__main__':
app.run(host='192.168.1.220', port=port)

Keybase proof

I hereby claim:

  • I am chacken on github.
  • I am hacken (https://keybase.io/hacken) on keybase.
  • I have a public key whose fingerprint is 3D46 D7F3 BC47 FC9F 653F 0ABC B5D3 3E90 1B5B 2575

To claim this, I am signing this object:

from pprint import pprint
import json
import random
import string
import httplib2
import wtforms as wtf
from flask import Blueprint
from flask import abort
from flask import g