Created
March 29, 2018 11:03
-
-
Save dima-kov/276b83e0a8d01000a1b02e5b7c908e18 to your computer and use it in GitHub Desktop.
uwsgi + ngnix config
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 { | |
charset utf-8; | |
listen 8000; | |
server_name 188.166.100.169; | |
client_max_body_size 10m; | |
access_log /var/sites/blog/log/nginx.access.log; | |
error_log /var/sites/blog/log/nginx.error.log; | |
keepalive_timeout 5; | |
root /var/sites/blog/src/blog/; | |
location / { | |
proxy_set_header Host $http_host; | |
proxy_set_header User-Agent $http_user_agent; | |
uwsgi_pass unix:///var/tmp/blog_uwsgi.sock; | |
include uwsgi_params; | |
uwsgi_buffers 8 128k; | |
} | |
location /media/ { | |
alias /var/sites/blog/media/; | |
expires 30d; | |
} | |
location /static/ { | |
alias /var/sites/blog/static/; | |
expires 30d; | |
} | |
} |
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] | |
socket = /var/tmp/blog_uwsgi.sock | |
virtualenv = /var/sites/blog/env | |
pythonpath = /var/sites/blog/src/blog | |
chdir = /var/sites/blog/src | |
env = DJANGO_SETTINGS_MODULE=settings | |
env = LANG=en_US.utf8 | |
module = wsgi | |
daemonize = /var/sites/blog/log/uwsgi.log | |
max-requests = 5000 | |
buffer-size = 32768 | |
harakiri = 30 | |
reload-mercy = 8 | |
master = 1 | |
processes = 2 | |
no-orphans = 1 | |
touch-reload = /var/sites/blog/uwsgi | |
uid = www-data | |
gid = www-data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment