JAVA Option '-Dhttp.nonProxyHosts' Does Not Work on Windows OS
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Problem
When Bitbucket Server is running on a Windows OS, if there is more than one host that needs to bypass the outgoing proxy and you have configured Bitbucket Server to use an outbound proxy with the -Dhttp.nonProxyHosts JVM argument, connections to those sites are not bypassing the proxy and the connection between the application running on those servers and Bitbucket Server is failing.
Environment
Bitbucket Server running on Windows OS only
Diagnosis
The error messages in the logs will vary based on what application you are connecting to. Removing the -Dhttp.nonProxyHosts setting from the Java arguments allows for Bitbucket Server to communicate with the servers correctly (but causes features like manage add-ons to loose connection to the Marketplace.
Cause
The -Dhttp.nonProxyHosts setting for Java is defined incorrectly.
Solution
Resolution
Change the
1
-Dhttp.nonProxyHosts=localhost|additionalhost1|*.yourdoman.com
OR
1
-Dhttp.nonProxyHosts="localhost\|additionalhost1\|*.yourdomain.com"
TO
1
-Dhttp.nonProxyHosts="localhost|additionalhost1|*.yourdomain.com"
(Note that the entire list of exceptions is enclosed in the " characters and the | (or) is not escaped with the \ character
To change this setting for Bitbucket Server Running as a process, .
Stop Bitbucket Server
Edit the <Bitbucket Server_Install>\bin\setenv.bat file
Modify the -Dhttp.nonProxyHosts setting
Save the file
Start Bitbucket Server
To change this setting for Bitbucket Server running as a service:
Stop Bitbucket Server Service
At a CMD prompt, change to the <Bitbucket Server_Install>/bin directory
Run tomcat8w.exe //ES//ServiceName (Default ServiceName is AtlassianBitbucket Server)
Click on the Java Tab
Edit the -Dhttp.nonProxyHosts setting
Save
Start the Bitbucket Server Service
This KB does not apply to Bitbucket Server running on Linux OS's.
Was this helpful?