Created
November 5, 2010 05:27
-
-
Save rafaelcaricio/663686 to your computer and use it in GitHub Desktop.
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; | |
| } | |
| upstream pre_server { | |
| server 127.0.0.1:8000; | |
| } | |
| server { | |
| listen 80; | |
| server_name localhost 127.0.0.1; | |
| client_max_body_size 10m; | |
| access_log /var/log/nginx/easyproject.access.log; | |
| location /media { | |
| root /home/development/atepassar/media; | |
| } | |
| location /media_admin { | |
| root /usr/local/lib/python2.6/dist-packages/Django-1.2.3-py2.6.egg/django/contrib/admin/media; | |
| } | |
| location / { | |
| default_type text/html; | |
| if ($request_method = POST) { | |
| proxy_pass http://easy_gunicorn; | |
| break; | |
| } | |
| proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; | |
| proxy_set_header host $http_host; | |
| proxy_pass http://pre_server; | |
| 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