Installing nginx and gunicorn - mlevans/warhol GitHub Wiki
-
brew install nginx
-
Change the default port to 80: stop the server with
sudo nginx -s stop
and edit nginx.conf (found at /usr/local/etc/nginx/nginx.conf)You can also use this sample to get nginx and gunicorn set up:
server { listen 80; server_name localhost; access_log /var/log/nginx/example.log; location / { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }
-
pip install gunicorn
(can do this with virtualenv as well) -
Start nginx again with
sudo nginx
-
Start gunicorn with
gunicorn -w 4 app:app