Skip to content

Instantly share code, notes, and snippets.

@Atalanta
Created December 31, 2010 01:14
Show Gist options
  • Select an option

  • Save Atalanta/760589 to your computer and use it in GitHub Desktop.

Select an option

Save Atalanta/760589 to your computer and use it in GitHub Desktop.
worker_processes 1;
user nobody nogroup;
pid /tmp/nginx.pid;
error_log /tmp/nginx.error.log;
events {
worker_connections 1024;
accept_mutex off;
}
http {
include mime.types;
default_type application/octet-stream;
access_log /tmp/nginx.access.log combined;
sendfile on;
upstream app_server {
#server unix:/tmp/gunicorn.sock fail_timeout=0;
# For a TCP configuration:
server 127.0.0.1:8000 fail_timeout=0;
}
server {
listen 80 default;
client_max_body_size 4G;
server_name _;
keepalive_timeout 5;
location /site_media/ {
root /srv/smartpages/current/static/site_media;
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://app_server;
break;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment