Jenkins : JenkinsBehindProxy

There are several background jobs in Jenkins which try and reach out on the Internet during normal operation. While this isn't an issue as long as the machine you're running Jenkins on has direct Internet access, it can lead to all kind of (sometimes inconsistent) issues as soon as the only way to get out on the Internet from Jenkins' perspective is an HTTP and / or HTTPS proxy server. This page tries to provide an overview and is supposed to help people who want to make sure they can use Jenkins properly behind a proxy server.

Background: What kind of proxy?

In order to understand your problem, you may want to find out what kind of proxy is deployed in your network. Actually, there are different major flavors of proxies and some of them come with subtle differences in individual implementations.

Please note that NAT (Network Address Translation) is not a proxy. In case your network just uses NAT to access the Internet, you should be fine and can stop reading here.

Just especially in larger and sometimes more conservative organizations network administrators think that access to the Internet needs to be mediated to say the least. As simple NAT does not provide any means of either filtering any content or of doing any caching, HTTP(S) proxies are usually introduced. If you can access you browser's network connection settings and there is anything configured like "HTTP proxy: some.proxy.net:1234" then you seem to be using an HTTP(S) proxy. Also in case there is any automated proxy configuration (proxy.pac or "determine proxy settings automatically") the automatically configured setup will most likely involve an HTTP(S) proxy.

How to find out the address and port number of your proxy to use is an exercise left to the reader. Use your preferred search engine if you have no idea how to find this out or ask your network administrator for more information.

Disclaimer:

Nothing explained on this page is meant to circumvent any policies that the network administrator has set or to access any content from the Internet which you couldn't also access using your web browser. The whole purpose of making Jenkins talk through proxies directly through the Internet is convenience. For example, Jenkins has a very convenient update mechanism for plugins. Any running instance of Jenkins will check the plugin repository on the Internet for newly available or updated plugins and allow you to install or update a plugin with just a mouse click. If Jenkins cannot achieve that because it cannot pass the proxy server and cannot reach out on the Internet, you could achieve the same by manually downloading the plugins and installing them. It means just more work for you.

How Jenkins handles Proxy Servers

You can configure the proxy server that Jenkins will use by going to Manage Jenkins > Manage Plugins > Advanced. This is preferred over setting JVM properties.

Here's a screenshot showing an example configuration:

Field

Description

Server

Host name or address of the proxy server. Example: proxy.example.com

Port

The port the proxy server listens on. Example: 8080

User name

If the proxy server requires authentication, enter the name of the user here.

Password

If the proxy server requires authentication, enter the password here.

No Proxy Host

If certain hosts must be contacted directly (without going through the proxy), you can specify their names here. You can even use * as a wildcard. Example: *jenkins-test*.example.com

Test URL

Enter the full URL of a host to use for testing the proxy configuration. Example: http://jenkins-ci.org/

To temporarily disable the proxy configuration, you can add a single wildcard character * on the first line. Erasing the value of Server will discard all values and disable the use of a proxy server.

Which plugins support a proxy server?

Attachments: