Skip to content

Commit

Permalink
Replace internal proxy pass with curl
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronJackson committed Apr 18, 2024
1 parent b116560 commit e03f9dc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion reverse_proxy/templates/generic.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ server {
# Internal only endpoint for performing a proxy pass to the cran mirror.
location /{{ generic_name }}-fetch {
internal;
proxy_pass {{ upstream_endpoint }};
rewrite_by_lua_block {
local uri = ngx.var.uri:gsub("{{ generic_name }}%-fetch", "")
local curl = io.popen("/usr/bin/curl \"{{ upstream_endpoint }}" .. uri .. "\"")
ngx.print(curl:read('*a'))
curl:close();
ngx.exit(ngx.HTTP_OK)
}
}

# Define an EICAR endpoint for verifying that the reverse proxy is
Expand Down

0 comments on commit e03f9dc

Please sign in to comment.