pixelfed: allow direct sending of files from storage directory

single-dockerfile
Trammell Hudson 2 years ago
parent b4ec015e62
commit b72d0bede9
  1. 2
      pixelfed.yaml
  2. 22
      pixelfed/nginx.conf

@ -79,9 +79,11 @@ services:
- ./pixelfed/env.production - ./pixelfed/env.production
# add the subdomain nginx configuration into the nginx volume # add the subdomain nginx configuration into the nginx volume
# as well as the storage directory for direct sendfile of static data
nginx: nginx:
volumes: volumes:
- ./pixelfed/nginx.conf:/etc/nginx/templates/pixelfed.conf.template:ro - ./pixelfed/nginx.conf:/etc/nginx/templates/pixelfed.conf.template:ro
- ./data/pixelfed/storage:/pixelfed/storage:ro
# add the subdomain client secrets to the keycloak-setup volume # add the subdomain client secrets to the keycloak-setup volume
keycloak: keycloak:

@ -13,7 +13,29 @@ server {
proxy_read_timeout 1800s; proxy_read_timeout 1800s;
# "GET /storage/m/_v2/502109601351254017/a48ad3dc0-89cf68/8vRxOkz65vOO/h4LB3lmyWrcyMxwcKeyJ8WTf3sEv3RVM8q5UYqA8.jpg HTTP/1.0"
# should go to data/pixelfed/storage/app/public/m/_v2/502109601351254017/a48ad3dc0-89cf68/8vRxOkz65vOO/h4LB3lmyWrcyMxwcKeyJ8WTf3sEv3RVM8q5UYqA8.jpg
# mapped to /pixelfed/storage
location /storage/ {
add_header X-Cache-Status STATIC;
alias /pixelfed/storage/app/public/;
#access_log off;
}
location / { location / {
proxy_cache mycache;
add_header X-Cache-Status $upstream_cache_status;
# PHP adds an Expires header that is causing cache miss
proxy_ignore_headers Cache-Control Set-Cookie Expires;
proxy_cache_valid any 1m;
# logged in sessions and PUT bypass the cache
proxy_cache_methods GET HEAD;
proxy_no_cache $cookie_rl_user_id;
proxy_cache_bypass $cookie_rl_user_id;
proxy_pass http://pixelfed-app/; proxy_pass http://pixelfed-app/;
#proxy_pass http://172.17.0.1:8080/; #proxy_pass http://172.17.0.1:8080/;
proxy_set_header Host $host; proxy_set_header Host $host;

Loading…
Cancel
Save