Skip to content

Instantly share code, notes, and snippets.

@rafaelcaricio
Created November 2, 2010 18:15
Show Gist options
  • Save rafaelcaricio/660043 to your computer and use it in GitHub Desktop.
Save rafaelcaricio/660043 to your computer and use it in GitHub Desktop.
Configurações do NGINX atualizadas.
upstream easy_gunicorn {
server 127.0.0.1:9000;
}
server {
listen 80;
server_name localhost 127.0.0.1;
client_max_body_size 10m;
access_log /var/log/nginx/easyproject.access.log;
location / {
default_type text/html;
if ($request_method = POST) {
proxy_pass http://easy_gunicorn;
break;
}
# monta a chave de consulta ao memcached.
set $memcached_key "easyproject:$uri";
memcached_pass localhost:11211;
proxy_intercept_errors on;
# se nao existir no cache a requisicao e repassada para o django.
error_page 404 502 501 = /django$uri;
}
location /django {
proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;
proxy_set_header host $http_host;
proxy_redirect off;
proxy_pass http://easy_gunicorn;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment