zoukankan      html  css  js  c++  java
  • 设置jenkins代理

    http://stackoverflow.com/documentation/jenkins/919/introduction-to-jenkins 

    Natively, Jenkins runs on port 8080. We can establish a proxy from port 80 -> 8080 so Jenkins can be accessed via:

    http://<url>.com
    

    instead of the default

    http://<url>.com:8080
    

    Begin by installing Nginx.

    sudo aptitude -y install nginx

    Remove the default settings for Nginx

    cd /etc/nginx/sites-available

    sudo rm default ../sites-enabled/default

    Create the new configuration file

    sudo touch jenkins

    Copy the following code into the newly created jenkins file.

    upstream app_server {
      server 127.0.0.1:8080 fail_timeout=0;
    }
    
    server {
      listen 80;
      listen [::]:80 default ipv6only=on;
      server_name ;
    
      location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_redirect off;
    
        if (!-f $request_filename) {
            proxy_pass http://app_server;
            break;
        }
      }
    }
    

    Create a symbolic link between sites-available and sites-enabled:

    sudo ln -s /etc/nginx/sites-available/jenkins /etc/nginx/sites-enabled/

    Restart the Nginx proxy service

    sudo service nginx restart

    Jenkins will now be accessible from port 80.

  • 相关阅读:
    Python requests“Max retries exceeded with url” error
    命令行链接mongo、redis、mysql
    python 删除字典某个key(键)及对应值
    python标准模块(二)
    python标准模块(一)
    格式化输出
    LeetCode----1. Two Sum
    文件操作(初阶)
    python函数基础
    python3内置函数
  • 原文地址:https://www.cnblogs.com/itech/p/5939741.html
Copyright © 2011-2022 走看看