Skip to content

Instantly share code, notes, and snippets.

@vindia
Created May 1, 2012 09:04
Show Gist options
  • Save vindia/2566602 to your computer and use it in GitHub Desktop.
Save vindia/2566602 to your computer and use it in GitHub Desktop.
Nginx config for Gunicorn
worker_processes 1;
user www-data;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
accept_mutex off;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
sendfile on;
tcp_nopush on;
tcp_nodelay off;
server_tokens off;
gzip on;
gzip_http_version 1.1;
gzip_proxied any;
gzip_min_length 500;
gzip_disable "MSIE [1-6]\.";
gzip_types text/plain text/xml text/css
text/comma-seperated-values
text/javascript application/x-javascript
application/atom+xml application/json
application/xml application/xml+rss;
upstream app_server {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response (in case the Unicorn master nukes a
# single worker for timing out).
server unix:/tmp/gunicorn.sock fail_timeout=0;
}
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment