Created
May 5, 2016 17:23
-
-
Save ajford/32ca09c1bdb67e2211247f189aa2ae9a to your computer and use it in GitHub Desktop.
uwsgi/nginx example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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