diff --git a/charts/artifacts/values.yaml b/charts/artifacts/values.yaml index 89b49ea..b174ff8 100644 --- a/charts/artifacts/values.yaml +++ b/charts/artifacts/values.yaml @@ -61,11 +61,13 @@ image: ## repository on the registry to pull from. ## - repository: scality/artifacts + repository: scality/artifacts/artifacts + + ## tag specifies the version to deploy. ## tag specifies the version to deploy. ## - tag: 4.2.13 + tag: e4353ee49de6d0ec3c3e3b7b0cd1d16cadf8730c ## pullPolicy specifies the image pull policy ## diff --git a/conf/nginx.conf.template b/conf/nginx.conf.template index ceadd77..cf650ac 100644 --- a/conf/nginx.conf.template +++ b/conf/nginx.conf.template @@ -251,7 +251,21 @@ http { # Handle "/builds/" location to keep backward compatibility with the # previous artifacts implementations. - # + # CLI clients (curl, wget, aria2c — no "Mozilla" in User-Agent) fetching + # a file are internally rewritten to /redirect/ so they receive a presigned + # URL and download directly from S3. Browser clients keep the original + # proxied-through-nginx behaviour (/download/). + # Directory listings (trailing slash) always go to /download/. + # + set $builds_backend "/download/"; + if ($http_user_agent !~* "Mozilla") { + set $builds_backend "/redirect/"; + } + # HEAD requests are metadata checks, not downloads: always proxy directly. + if ($request_method = "HEAD") { + set $builds_backend "/download/"; + } + rewrite ^/builds/([^/]+/.+[^/])$ $builds_backend$1 last; rewrite ^/builds/(.*)$ /download/$1 last; # Handle subdir listing under "/redirect/"