56 lines
1.4 KiB
Django/Jinja
56 lines
1.4 KiB
Django/Jinja
upstream app_server_{{ extended_name }} {
|
|
# fail_timeout=0 means we always retry an upstream even if it failed
|
|
# to return a good HTTP response
|
|
|
|
# for UNIX domain socket setups
|
|
server unix:/tmp/gunicorn.{{ extended_name }}.sock fail_timeout=0;
|
|
|
|
# for a TCP configuration
|
|
# server 192.168.0.7:8000 fail_timeout=0;
|
|
# server {{django_host}}:{{django_port}} fail_timeout=0;
|
|
}
|
|
|
|
server {
|
|
listen {{port}};
|
|
server_name .{{server_name}}
|
|
|
|
charset utf-8;
|
|
|
|
client_max_body_size 75M;
|
|
|
|
access_log {{access_log}};
|
|
error_log {{error_log}};
|
|
|
|
location /media {
|
|
alias {{ server_media_dynamic }};
|
|
}
|
|
|
|
location /static/debug_toolbar {
|
|
alias {{virtualenv_sitepackages}}/debug_toolbar/static/debug_toolbar;
|
|
}
|
|
|
|
location /static {
|
|
alias {{ server_media_static}};
|
|
}
|
|
|
|
location / {
|
|
proxy_pass_header Server;
|
|
proxy_set_header Host $http_host;
|
|
proxy_redirect off;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Scheme $scheme;
|
|
proxy_connect_timeout 10;
|
|
proxy_read_timeout 10;
|
|
proxy_pass http://app_server_{{ extended_name }};
|
|
|
|
# uwsgi_pass django;
|
|
# include /Users/ronny/projects/django/replyall.dev/uwsgi_params;
|
|
# #root /usr/local/var/www/test;
|
|
# #index index.html index.htm;
|
|
}
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
location = /50x.html {
|
|
root html;
|
|
}
|
|
}
|