[SOLVED] Unable to use https proxy for outbound connections

Hello, I have an instance of metabase running as a service on Ubuntu, with apache acting as a reverse proxy and everything is working as expected except when metabase needs to do an outbound request (such as for importing geojson or checking for an update) since my server use an http/https proxy for everything internet related, and I'm not able to configure it. This is what I've tried, based on searches on the internet and this forum as well:

starting the service with command line options

 /usr/bin/java  -Dhttps.proxyHost=<proxy_address> -Dhttps.proxyPort=3128 -Dhttp.proxyHost=<proxy_address> -Dhttp.proxyPort=3128 -jar /home/metabase/metabase.jar

setting

http.proxyHost=<proxy_address> 
http.proxyPort=3128
https.proxyHost=<proxy_address> 
https.proxyPort=3128

into /etc/java-11-openjdk/net.properties

and also the environment variables https_proxy and http_proxy are correctly set (many other web applications on the server can access the internet without any problem)

I don't know what to try next, any help will be much appreciated
Francesco

Hi @ilfrance
So everything looks correct, but you shouldn't need defining the settings multiple times.
Do you have any other Java applications?
Is your host a DNS or IP - if IP, is it v4 or v6?
You don't have other things in place like firewalls, which could prevent the Java process from accessing the proxy?

Hi, and thank you for your reply, sorry I wasn't clear but I'm not defining all those settings together, those are just the various things I've tried, but none of that works.
The host is a virtual server with ubuntu server 20.04 but unfortunately I don't know the specific, I just know that every http or https outbound request must go through the proxy, and every other outbound port is blocked.
Also, unfortunately I don't have any other java application, but I've setup Rails, PHP and NodeJS application and all of these can access internet resources by setting the proxy

hey @flamber I've solved it. Seems like java wants the proxy host options set WITHOUT http:// in front of it, while ubuntu env variable for proxies requires it.
Thanks for your help

1 Like