Can't upgrade to new version because of proxy

When I try to upgrade to the latest version, the bootstrapper errors out because of the configured http proxy :

[...]
I, [2022-04-14T13:16:11.409590 #1]  INFO -- : Replacing pid /run/nginx.pid; with daemon off; in /etc/nginx/nginx.conf
I, [2022-04-14T13:16:11.410003 #1]  INFO -- : Replacing (?m-ix:upstream[^\}]+\}) with upstream discourse { server 127.0.0.1:3000; } in /etc/nginx/conf.d/discourse.conf
I, [2022-04-14T13:16:11.410374 #1]  INFO -- : Replacing (?-mix:server_name.+$) with server_name _ ; in /etc/nginx/conf.d/discourse.conf
I, [2022-04-14T13:16:11.411104 #1]  INFO -- : Replacing (?-mix:client_max_body_size.+$) with client_max_body_size $upload_size ; in /etc/nginx/conf.d/discourse.conf
I, [2022-04-14T13:16:11.412004 #1]  INFO -- : Replacing (?-mix:worker_connections.+$) with worker_connections $nginx_worker_connections ; in /etc/nginx/nginx.conf
I, [2022-04-14T13:16:11.412403 #1]  INFO -- : > echo "done configuring web"
I, [2022-04-14T13:16:11.414313 #1]  INFO -- : done configuring web

I, [2022-04-14T13:16:11.414765 #1]  INFO -- : > cd /var/www/discourse && gem install bundler --conservative -v $(awk '/BUNDLED WITH/ { getline; gsub(/ /,""); print $0 }' Gemfile.lock)
ERROR:  While executing gem ... (URI::InvalidURIError)
    bad URI(is not URI?): "http://\\!<redacted login>:<redacted password>@<redacted proxy host>:8090/"

Right now discourse if offline, and using discourse-doctor didn’t restart the previous version.

Does anyone know how to circumvent this ?

Thank you