在nginx中设置jenkins的反向代理
发表于:2022-03-01 |
 1.修改nginx 的config文件,一般在/etc/nginx/nginx.conf,在server 中添加location块
 
 ···
     location /jenkins{
        proxy_pass http://jenkins_ip:jenkins_port;
        proxy_redirect http:// https://;
        sendfile off;
 
         proxy_set_header   Host             $host:$server_port;
         proxy_set_header   X-Real-IP        $remote_addr;
         proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
         proxy_max_temp_file_size 0;
 
         #this is the maximum upload size
         client_max_body_size       10m;
         client_body_buffer_size    128k;
 
         proxy_connect_timeout      90;
         proxy_send_timeout         90;
         proxy_read_timeout         90;
 
         proxy_temp_file_write_size 64k;
         # Required for new HTTP-based CLI
         proxy_http_version 1.1;
         proxy_request_buffering off;
         proxy_buffering off; # Required for HTTP-based CLI to work over SSL
    }
 ···
 
上一篇:
Nginx Log日志统计分析常用命令
下一篇:
使用DockerCompose搭建Redis集群