Skip to content

Set up NGINX proxy cache#2003

Draft
kysrpex wants to merge 1 commit intousegalaxy-eu:masterfrom
kysrpex:nginx_cache
Draft

Set up NGINX proxy cache#2003
kysrpex wants to merge 1 commit intousegalaxy-eu:masterfrom
kysrpex:nginx_cache

Conversation

@kysrpex
Copy link
Copy Markdown
Contributor

@kysrpex kysrpex commented Apr 13, 2026

Configure proxy_cache_path and define a macro upstream_galaxy_cache() that allows NGINX to cache content by itself for a given location, so that requests do not have to be sent to the (slow Python) upstream. Use it to cache the favicon and /static.

Using this approach, static files are still served by Galaxy, which knows best where to find them (especially regarding edge cases, such as per-subdomain static files); but NGINX caches them so that gunicorns have to work very little (once every 30m).

Closes https://github.com/usegalaxy-eu/issues/issues/919, https://github.com/usegalaxy-eu/issues/issues/927. Supersedes #2001.

⚠️ The Galaxy EU favicon may be replaced with the Galaxy Project favicon unless #1996 is merged too.

Configure `proxy_cache_path` and define a macro `upstream_galaxy_cache()` that allows NGINX to cache content by itself for a given location, so that requests do not have to be sent to the (slow Python) upstream. Use it to cache the favicon and `/static`.

Using this approach, static files are still served by Galaxy, which knows best where to find them (especially regarding edge cases, such as per-subdomain favicons); but NGINX caches them so that gunicorns have to work very little (once every 30m).
@kysrpex
Copy link
Copy Markdown
Contributor Author

kysrpex commented Apr 13, 2026

If you like this idea we could integrate nginx_cache_dir into usegalaxy-eu.nginx.

    - role: nginx_cache_dir
      vars:
        nginx_cache_dir_owner: root
        nginx_cache_dir_group: root
        nginx_cache_dir_mode: "0777"
    - usegalaxy-eu.nginx
    - nginx_cache_dir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant