Created
November 24, 2014 11:40
-
-
Save hirokazumiyaji/290d31f559a593e26c04 to your computer and use it in GitHub Desktop.
nginx + uwsgi conf
This file contains hidden or 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
user root; | |
worker_processes 4; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
use epoll; | |
multi_accept on; | |
} | |
http { | |
sendfile on; | |
tcp_nopush on; | |
tcp_nodelay on; | |
keepalive_timeout 65; | |
types_hash_max_size 2048; | |
include /etc/nginx/mime.types; | |
default_type application/octet-stream; | |
log_format ltsv "remote_addr:$remote_addr\t" | |
"remote_user:$remote_user\t" | |
"time_local:$time_local\t" | |
"request:$request\t" | |
"status:$status\t" | |
"body_bytes_sent:$body_bytes_sent\t" | |
"http_refer:$http_referer\t" | |
"http_user_agent:$http_user_agent"; | |
access_log /var/log/nginx/access.log ltsv; | |
error_log /var/log/nginx/error.log; | |
gzip on; | |
gzip_disable "msie6"; | |
gzip_vary on; | |
gzip_proxied any; | |
gzip_comp_level 6; | |
gzip_buffers 16 8k; | |
gzip_http_version 1.1; | |
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; | |
include /etc/nginx/conf.d/*.conf; | |
} |
This file contains hidden or 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 localhost; | |
location / { | |
include uwsgi_params; | |
uwsgi_pass unix:///var/run/uwsgi/uwsgi.sock; | |
} | |
} |
This file contains hidden or 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
#!/usr/bin/sh | |
uwsgi --chdir=/var/webapp/app \ | |
--module='app.wsgi:application' \ | |
--env DJANGO_SETTINGS_MODULE=app.settings \ | |
--master \ | |
--pidfile=/tmp/uwsgi-master.pid \ | |
--socket=/var/run/uwsgi/uwsgi.sock \ | |
--processes=5 \ | |
--max-requests=5000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment