Skip to main content
ubuntuask.com

Back to all posts

How to Set A Proxy In the Jenkins Pipeline?

Published on
6 min read
How to Set A Proxy In the Jenkins Pipeline? image

Best Proxy Configuration Tools to Buy in December 2025

1 Replacement PUF-CO Proxy Part Protectors for Welding Tips Accessories (brown)

Replacement PUF-CO Proxy Part Protectors for Welding Tips Accessories (brown)

  • DURABLE DESIGN ENHANCES WELDING TIP LONGEVITY AND REDUCES COSTS.
  • EASY INSTALLATION SAVES TIME, BOOSTING PRODUCTIVITY IN WELDING TASKS.
  • COMPATIBLE WITH MULTIPLE WELDING TIPS FOR VERSATILE USE AND EFFICIENCY.
BUY & SAVE
$24.58 $25.98
Save 5%
Replacement PUF-CO Proxy Part Protectors for Welding Tips Accessories (brown)
2 4 PCS End Tuft Toothbrush Adult, Gum End Tuft Toothbrush for Braces, Orthodontic Toothbrushs Small Head Interspace Proxy Brush Dental Tools with Soft Gap Small Head for Tooth Detail Cleaning

4 PCS End Tuft Toothbrush Adult, Gum End Tuft Toothbrush for Braces, Orthodontic Toothbrushs Small Head Interspace Proxy Brush Dental Tools with Soft Gap Small Head for Tooth Detail Cleaning

  • COMPACT SIZE & VIBRANT COLORS FOR EASY HANDLING AND PERSONALIZATION.

  • ULTRA-SOFT BRISTLES GENTLY CLEAN SENSITIVE GUMS AND HARD-TO-REACH AREAS.

  • ANGLED DESIGN & ANTI-SLIP HANDLE ENSURE COMFORT AND PRECISION IN USE.

BUY & SAVE
$4.99
4 PCS End Tuft Toothbrush Adult, Gum End Tuft Toothbrush for Braces, Orthodontic Toothbrushs Small Head Interspace Proxy Brush Dental Tools with Soft Gap Small Head for Tooth Detail Cleaning
3 WEN 23114 1.4-Amp High-Powered Variable Speed Rotary Tool with Cutting Guide, LED Collar, 100+ Accessories, Carrying Case and Flex Shaft

WEN 23114 1.4-Amp High-Powered Variable Speed Rotary Tool with Cutting Guide, LED Collar, 100+ Accessories, Carrying Case and Flex Shaft

  • BOOST POWER WITH 1.4-AMP MOTOR FOR SUPERIOR PERFORMANCE!

  • VERSATILE ACCESSORIES AND INNOVATIVE COLLARS FOR EVERY PROJECT!

  • ORGANIZE EFFORTLESSLY WITH A MULTI-COMPARTMENT CARRYING CASE!

BUY & SAVE
$32.05
WEN 23114 1.4-Amp High-Powered Variable Speed Rotary Tool with Cutting Guide, LED Collar, 100+ Accessories, Carrying Case and Flex Shaft
4 Replacement PUF-CO Proxy Part Protectors for Welding Tips Accessories (white)

Replacement PUF-CO Proxy Part Protectors for Welding Tips Accessories (white)

  • DURABLE PUF-CO PROTECTS WELDING TIPS FOR LONGER TOOL LIFE.
  • EASY INSTALLATION ENSURES SEAMLESS OPERATION DURING WELDING TASKS.
  • COST-EFFECTIVE SOLUTION TO ENHANCE EFFICIENCY AND REDUCE DOWNTIME.
BUY & SAVE
$24.58
Replacement PUF-CO Proxy Part Protectors for Welding Tips Accessories (white)
5 Zed Attack Proxy Cookbook: Hacking tactics, techniques, and procedures for testing web applications and APIs

Zed Attack Proxy Cookbook: Hacking tactics, techniques, and procedures for testing web applications and APIs

BUY & SAVE
$22.39
Zed Attack Proxy Cookbook: Hacking tactics, techniques, and procedures for testing web applications and APIs
6 Ladder Stabilizer,Heavy Duty Aluminum Extended Ladder Accessory for Roof Gutter Guard Cleaning Tools,Ladder Stand-Off Wing Span/Wall Ladder Hooks with Non-Slip Rubber Bottom pad.(Patent)

Ladder Stabilizer,Heavy Duty Aluminum Extended Ladder Accessory for Roof Gutter Guard Cleaning Tools,Ladder Stand-Off Wing Span/Wall Ladder Hooks with Non-Slip Rubber Bottom pad.(Patent)

  • PROTECT WALLS AND GUTTERS WITH NON-SLIP, SCRATCH-FREE MATS.

  • LIGHTWEIGHT ALUMINUM DESIGN ENSURES EASY LADDER MOVEMENT AND USE.

  • UNIVERSAL FIT FOR VARIOUS LADDER TYPES ENHANCES VERSATILITY IN TASKS.

BUY & SAVE
$39.99
Ladder Stabilizer,Heavy Duty Aluminum Extended Ladder Accessory for Roof Gutter Guard Cleaning Tools,Ladder Stand-Off Wing Span/Wall Ladder Hooks with Non-Slip Rubber Bottom pad.(Patent)
+
ONE MORE?

To set a proxy in the Jenkins pipeline, you can follow the steps below:

  1. Open your Jenkins pipeline script or Jenkinsfile.
  2. Define the proxy settings at the start of the pipeline script by adding the following lines:

node { // Set proxy environment variables withEnv(["http_proxy=http://proxy.example.com:8080", "https_proxy=http://proxy.example.com:8080"]) { // Your pipeline steps here } }

Make sure to replace proxy.example.com:8080 with the actual proxy server and port you want to use.

  1. Inside the withEnv block, you can include all the pipeline steps that you want to execute while using the proxy settings.
  2. Save the pipeline script.

By setting the http_proxy and https_proxy environment variables using the withEnv block, Jenkins will use the specified proxy server for all HTTP and HTTPS connections made during the execution of the pipeline steps.

How to set a proxy for Jenkins pipeline on Windows?

To set a proxy for Jenkins pipeline on Windows, you can follow these steps:

  1. Open the Jenkins web interface in your browser by visiting http://localhost:8080.
  2. Click on "Manage Jenkins" on the left-hand side menu.
  3. In the Manage Jenkins page, click on "Manage Plugins".
  4. Go to the "Advanced" tab and scroll down to the "HTTP Proxy Configuration" section.
  5. Enable the "Use proxy" checkbox.
  6. Enter the proxy server address and port in the respective fields. For example, if the proxy server address is proxy.example.com and the port is 8080, enter proxy.example.com:8080.
  7. If your proxy server requires authentication, enable the "Use proxy authentication" checkbox. Enter the username and password credentials in the respective fields.
  8. Click on the "Test Proxy Configuration" button to verify if the proxy settings are correct.
  9. Click on "Apply" and then "Save" to save the changes.

After setting up the proxy configuration in Jenkins, your pipeline jobs will use the configured proxy settings for any external network connections.

What are the potential issues with proxy configuration in Jenkins pipelines?

There are several potential issues with proxy configuration in Jenkins pipelines:

  1. Proxy Authentication: If the proxy server requires authentication, the pipeline may fail if the credentials are not provided correctly or if there are issues with the authentication mechanism.
  2. Proxy Settings: Incorrect or missing proxy settings in the Jenkins configuration can result in the pipeline not being able to reach external resources through the proxy server.
  3. Network Connectivity: Network connectivity issues between Jenkins and the proxy server can cause the pipeline to fail. This could be due to firewall rules, network configuration problems, or other network-related issues.
  4. Proxy Server Stability: If the proxy server is not stable or experiences downtime, it can disrupt the pipeline's ability to access external resources. This can lead to pipeline failures or delays.
  5. SSL/TLS Certificates: If the proxy server uses SSL/TLS encryption, the pipeline may encounter issues with certificate validation. Misconfigured or expired certificates can cause SSL handshake failures and prevent the pipeline from establishing a secure connection.
  6. Proxy Server Performance: If the proxy server is overloaded or has limited capacity, it can result in slow network access for the pipeline. This can impact the overall pipeline performance and cause delays.
  7. Proxy Bypass Rules: Incorrectly configured proxy bypass rules can lead to unexpected behavior in the pipeline. If certain resources are excluded from proxy usage but should not be, or vice versa, it can result in issues with accessing those resources.
  8. Environment Variables: Incorrectly set or missing environment variables related to proxy configuration can cause problems. It is important to ensure that the necessary environment variables are correctly set within the pipeline.

To mitigate these issues, it is advisable to carefully configure proxy settings in Jenkins, test connectivity and authentication, and have proper monitoring and alerting in place to identify and address any potential problems.

How to set a proxy in the Jenkins pipeline?

To set a proxy in the Jenkins pipeline, you can use the withEnv step to set the necessary environment variables. Here's an example of how you can set the proxy:

pipeline { agent any

environment {
    http\_proxy = "http://proxy.example.com:8080"    // Replace with your proxy URL
    https\_proxy = "http://proxy.example.com:8080"   // Replace with your proxy URL
    no\_proxy = "localhost,127.0.0.1"                // Replace with your exceptions (if any)
}

stages {
    stage('Build') {
        steps {
            // Your build steps here
            // The proxy configurations will be used for these steps
        }
    }
}

}

Make sure to replace the proxy URL with the correct address of your proxy server. Additionally, you can add any exceptions to the no_proxy variable if needed.

Note that setting the proxy environment variables will only affect the steps within the stage block. If you have multiple stages in your pipeline, you may need to repeat the environment block for each stage where the proxy configuration is required.

What is the difference between a forward proxy and a reverse proxy?

A forward proxy and a reverse proxy serve different purposes in a network.

Forward Proxy:

  • A forward proxy acts as an intermediary between a client (usually a user or a device) and a server.
  • When a client makes a request to access a web resource, the request is first sent to the forward proxy server.
  • The forward proxy server then forwards the request to the internet on behalf of the client.
  • It can be used to add an extra layer of security, filter and block certain content, cache data, or anonymize the client's IP address.
  • The client is generally unaware of the forward proxy's existence.

Reverse Proxy:

  • A reverse proxy, on the other hand, acts as an intermediary between the internet and servers in a private network.
  • When a client makes a request to access a web resource, the request is first sent to the reverse proxy server.
  • The reverse proxy server then forwards the request to the appropriate server within the private network that can fulfill the request.
  • It helps distribute incoming requests across multiple servers to balance the load and ensure better performance and availability.
  • It can also provide additional security measures such as SSL encryption, caching, or acting as a firewall to protect the servers in the private network.
  • The client is generally aware of the reverse proxy's existence as it directly communicates with it to access the resources.