Files
recipes/http.d/Recipes.conf.template
2025-10-08 07:42:09 +02:00

36 lines
902 B
Plaintext

server {
listen ${TANDOOR_PORT};
listen [::]:${TANDOOR_PORT} ipv6only=on;
server_name localhost;
client_max_body_size 128M;
# serve media files
location /media {
alias ${MEDIA_ROOT};
add_header Content-Disposition 'attachment; filename="$args"';
}
# serve service worker under main path
location = /service-worker.js {
alias ${STATIC_ROOT}/vue3/service-worker.js;
}
# pass requests for dynamic content to gunicorn
location / {
proxy_set_header Host $http_host;
proxy_pass http://unix:/run/tandoor.sock;
# param needed by django allauth sessions to log IP
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# disabled for now because it redirects to the error page and not back, also not showing html
#error_page 502 /errors/http502.html;
}
location /errors/ {
alias /etc/nginx/http.d/errorpages/;
internal;
}
}