django-for-runners_ynh/conf/nginx.conf

29 lines
761 B
Nginx Configuration File
Raw Normal View History

2020-12-12 19:37:20 +01:00
location __PATH__/static/ {
2022-09-18 17:44:41 +02:00
# Service static files by nginx
# e.g.: /var/www/$app/static/
alias __INSTALL_DIR__/static/;
2020-12-22 18:52:00 +01:00
expires 30d;
2020-12-12 19:37:20 +01:00
}
2021-01-17 11:47:19 +01:00
location __PATH__/ {
2020-12-22 18:52:00 +01:00
# https://github.com/benoitc/gunicorn/blob/master/examples/nginx.conf
2020-12-12 19:37:20 +01:00
2020-12-22 18:52:00 +01:00
# this is needed if you have file import via upload enabled
client_max_body_size 100M;
2020-12-12 19:37:20 +01:00
2020-12-22 18:52:00 +01:00
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
2020-12-12 19:37:20 +01:00
2020-12-22 18:52:00 +01:00
proxy_read_timeout 30;
proxy_send_timeout 30;
proxy_connect_timeout 30;
proxy_redirect off;
2020-12-12 19:37:20 +01:00
2021-01-17 11:47:19 +01:00
proxy_pass http://127.0.0.1:__PORT__;
2020-12-12 19:37:20 +01:00
}