Skip to content

Instantly share code, notes, and snippets.

@robcee
Created April 21, 2012 14:51
Show Gist options
  • Save robcee/2437511 to your computer and use it in GitHub Desktop.
Save robcee/2437511 to your computer and use it in GitHub Desktop.
Sample BrowserID + Nginx + Proxy setup (can work for node, django, flask, etc)
upstream gunicorn_frontends {
# We define the binding of the gunicorn web server
server 127.0.0.1:8000;
}
# we need to redirect www since browserid thinks www and non-www are different
server {
listen 80;
server_name www.yourdomain.com;
rewrite ^ http://yourdomain.com$uri permanent;
}
server {
listen 80;
server_name yourdomain.com;
access_log /var/www/yourdomain.com/logs/access.log;
error_log /var/www/yourdomain.com/logs/error.log;
location / {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass http://gunicorn_frontends;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment