Skip to content

fix(uwsgi): add cache headers, redirects, et al., from olympia.ini#374

Merged
Sancus merged 1 commit intostagefrom
fix/uwsgi-file-serving-config
Mar 20, 2026
Merged

fix(uwsgi): add cache headers, redirects, et al., from olympia.ini#374
Sancus merged 1 commit intostagefrom
fix/uwsgi-file-serving-config

Conversation

@e9e4e5f0faef
Copy link
Copy Markdown
Collaborator

Summary

  • Port remaining uWSGI file-serving settings from the Ansible config (olympia.ini)
  • Adds cache headers, HTTP-to-HTTPS redirect, Firefox/Android redirect, attachment headers, and sendfile support

Changes

File Change
docker/docker-entrypoint.sh Add static-safe, static-expires, route-if, route-uri, collect-header, and response-route directives to start_web()

Why

PR #372 fixed the immediate static file 404s with --static-map. This PR carries over the remaining uWSGI settings from thundernest-ansible/addons/olympia.ini that affect performance and behaviour:

  • static-expires: 90-day cache headers (addresses reported slowness)
  • static-safe: allows serving user-media uploads and add-on files
  • route-if: HTTP-to-HTTPS redirect
  • route-uri: redirects Firefox/Android paths to addons.mozilla.org
  • route-uri: content-disposition header for attachment downloads
  • collect-header and response-route-if-not: X-Accel-Redirect sendfile for efficient large file serving

Reference: thundernest-ansible/addons/olympia.ini lines 55-67

Safety

No impact on running services until the new image is deployed. All settings are read-only file serving behaviour.

Follow-up

EFS mount targets (separate PR) will provide the actual persistent storage behind the user-media and files paths.

@e9e4e5f0faef e9e4e5f0faef requested review from Sancus March 19, 2026 21:26
@e9e4e5f0faef e9e4e5f0faef self-assigned this Mar 19, 2026
@Sancus Sancus merged commit ddcc29a into stage Mar 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants