Jenkins Version - Jenkins 2.462.1 (facing issue with HTTP Proxy in Global Config)

Hi Team,
We are Trying to update our jenkins 2.462.1 from [Jenkins 2.249.2]
So we are facing issue with the HTTP proxy as it was earlier manage plugins section refer in below.


But in the New version 2.462.1 it is moved to the Global config section

Previously, we didn’t face any issues, but now whenever we clone the code, it’s going through the proxy and getting cloned successfully. However, the problem is that we have multiple jobs across different environments, and the proxy we’re using is specific to the lower environment. As a result, for the production and beta environments, the cloning is failing because it’s using the same proxy as the lower environment.

How can we set a proxy at the node level for each environment, so that each node uses its respective proxy when cloning the code, instead of using the global proxy?
By the way give me solution for freestyle…as we are using Free style jobs…
we are using swarm to connect our nodes using script below.

#!/bin/bash
export https_proxy=http://
export http_proxy=http://
# Start jenkins-slave service

{% for k,v in jenkins_slave_env_vars.items() %}
export {{ k }}={{ v }}
{% endfor %}

/usr/bin/java -jar \
-Dhttp.nonProxyHosts={{ non_ProxyHosts }} \
-Djava.io.tmpdir=/opt/oxygen \
"{{ jenkins_slave_jar_dir }}/swarm-client.jar" \
-master "{{ jenkins_master_url }}" \
-name "{{ jenkins_slave_name }}-{{ ansible_default_ipv4.address }}" \
-fsroot "{{ jenkins_slave_working_dir }}" \
{% for item in jenkins_slave_labels %}-labels "{{ item }}" {% endfor %} \
-username "{{ jenkins_master_remote_user }}" -password "{{ jenkins_master_remote_user_pass }}" \
-executors {{ jenkins_slave_executors }} {% if jenkins_master_tunnel|length %}-tunnel {{ jenkins_master_tunnel }}{% endif %}

The Jenkins nodes are connecting successfully, and we are using individual proxies specific to each environment. How can we configure Jenkins to use these agent level proxies when cloning repositories?

I have the exact same problem. The nodes on my Jenkins system (as well as the are all configured with different proxy settings, and previously we specified the http_proxy and https_proxy environment variables in the settings for each Jenkins node. That worked fine until we upgraded to Jenkins 2.516.1. Now the Jenkins nodes ignore the environment variables while cloning from GitHub, and they all try to use the proxy that is configured for the Jenkins server, and the jobs all fail as a result.

Can you try to configure git on the agent to use a proxy via

git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080

@mawinter69 That might have worked but then I wouldn’t be able to change the agent settings on the controller UI itself. What ended up working was:

  • Check “Environment variables” in the agent configuration page, and define HTTP_PROXY and HTTPS_PROXY correctly for the agent.
  • Check “Prepare jobs environment” in the agent configuration page, and uncheck “Unset System Environment Variables”.
1 Like