Skip to content

Instantly share code, notes, and snippets.

@ajford
Created May 5, 2016 17:23
Show Gist options
  • Save ajford/32ca09c1bdb67e2211247f189aa2ae9a to your computer and use it in GitHub Desktop.
Save ajford/32ca09c1bdb67e2211247f189aa2ae9a to your computer and use it in GitHub Desktop.
uwsgi/nginx example
/var/www/apps
├── FoobarApp/
│ └── foobar/
│ ├── __init__.py
│ ├── static/
│ │ ├── imgs/
│ │ │ └── favicon.ico
│ │ └── js/
│ │ ├── admin.js
│ │ ├── common.js
│ │ └── jquery.js
│ ├── templates/
│ ├── views/
│ │ ├── admin.py
│ │ ├── __init__.py
│ │ └── main.py
│ └── wsgi.py
├── logs/
│ └── foobar.log
├── venvs/
└── wsgi/
└── foobar.wsgi
[uwsgi]
; Placeholders:
flaskapp_root = /var/www/apps
app_name = FoobarApp
virtualenv = %(flaskapp_root)/venvs/%(app_name)_venv
module = foobar.wsgi
plugins=python
uid = nginx
gid = staff
socket = 127.0.0.1:7000
chown-socket = nginx:nginx
chmod-socket = 660
;
logto = %(flaskapp_root)/logs/%(app_name).log
logfile-chown = on
logfile-chmod = 644
master = true
processes = 5
vacuum = true
server {
listen 80;
server_name foobar.example.com;
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:7000;
}
location /static {
alias /var/www/apps/FoobarApp/foobar/static/;
}
}
#from . import app
from . import create_app
# uwsgi expects the WSGI app to be a callable named application
#application = app
# Create application since we're using a factory
application = create_app()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment