mesa/docs/ci/uri-caching.conf
Eric Engestrom 3c0e0c3d04
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
ci: document http proxy bug & disable farms relying on it
All the lava & baremetal farms have to be disabled because of this bug,
and until a fix is found and deployed to each of these farms.
2025-03-24 19:54:25 +01:00

39 lines
1.3 KiB
Text

set $proxy_authorization '';
set_by_lua $proxyuri '
unescaped = ngx.unescape_uri(ngx.var.arg_uri);
it, err = ngx.re.match(unescaped, "(https?://)(.*@)?([^/]*)(/.*)?");
if not it then
-- Hack to cause nginx to return 404
return "http://localhost/404"
end
scheme = it[1];
authstring = it[2];
host = it[3];
query = it[4];
if ngx.var.http_authorization and ngx.var.http_authorization ~= "" then
ngx.var.proxy_authorization = ngx.var.http_authorization;
elseif authstring then
auth = string.sub(authstring, 0, -2);
auth64 = ngx.encode_base64(auth);
ngx.var.proxy_authorization = "Basic " .. auth64;
end
-- Default to / if none is set to avoid using the request_uri query
if not query then
query = "/";
end
return scheme .. host .. query;
';
add_header X-GG-Cache-Status $upstream_cache_status;
proxy_set_header Authorization $proxy_authorization;
proxy_pass $proxyuri;
# Redirect back to ourselves on 301 replies
# FIXME: this is buggy, it doesn't properly url-encode $1, leading to s3 creds
# being dropped during the redirection, breaking all the lava & baremetal jobs
proxy_redirect ~^(.*)$ /cache/?uri=$1;