Created
November 2, 2010 18:15
-
-
Save rafaelcaricio/660043 to your computer and use it in GitHub Desktop.
Configurações do NGINX atualizadas.
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
| 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