2023-05-22 18:08:10 +03:00
|
|
|
upstream app_server_{{extended_name}} {
|
|
|
|
|
|
|
|
|
|
# for UNIX domain socket setups
|
|
|
|
|
server unix:/tmp/gunicorn.{{ extended_name }}.sock fail_timeout=0;
|
|
|
|
|
|
|
|
|
|
# server http://{{django_host}}:{{django_port}} fail_timeout=0;
|
|
|
|
|
}
|
|
|
|
|
|
2016-09-06 14:43:49 +03:00
|
|
|
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;
|
2023-05-22 18:08:10 +03:00
|
|
|
# proxy_pass http://{{django_host}}:{{django_port}}/;
|
|
|
|
|
proxy_pass http://app_server_{{extended_name}};
|
2016-09-06 14:43:49 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
|
|
|
location = /50x.html {
|
|
|
|
|
root html;
|
|
|
|
|
}
|
|
|
|
|
}
|