美文网首页
gitlab优化禁用自带nginx和prometheus_mon

gitlab优化禁用自带nginx和prometheus_mon

作者: 耍帅oldboy | 来源:发表于2021-08-11 23:19 被阅读0次
    vim /etc/gitlab/gitlab.rb
    
    将
    nginx['enable'] = true
    修改为
    nginx['enable'] = false
    并去掉注释 (前边的#)
    
    gitlab_workhorse['enable'] = true
    gitlab_workhorse['listen_network'] = "tcp"
    gitlab_workhorse['listen_addr'] = "127.0.0.1:9000"  //这个端口号一会和Nginx代理的端口号要一致
     #重启
    gitabl-clt reconfigure
    gitlab-ctl restart
    

    禁用prometheus_monitoring 网络监控

    prometheus_monitoring['enable'] = false
    

    使用服务原本的nginx转发

        location / {
                    proxy_pass http://127.0.0.1:9000;
                    #root html;
                    client_max_body_size 0;
                    proxy_redirect             off;
                    proxy_set_header           Host $host;
                    proxy_set_header           X-Real-IP $remote_addr;
                    proxy_set_header           X-Forwarded-For $proxy_add_x_forwarded_for;
                    index index.html index.htm;
                    proxy_set_header X-Forwarded-Proto https;
            }
    
    server {
         listen       80;  
         client_max_body_size 0; #一定要加上这个参数,gitlab push大小限制,0表示没有大小限制
         server_name  xxxxxxx.com;
         server_tokens off;
         location / {
              root  html;
              index index.html index.htm;
              proxy_pass http://127.0.0.1:9000; #这里与前面设置过的端口一致
              proxy_read_timeout      3600;
              proxy_connect_timeout   300;
              proxy_redirect          off;
              proxy_http_version 1.1;
              proxy_set_header Host $http_host;
              proxy_set_header X-Real-IP $remote_addr;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              proxy_set_header X-Forwarded-Proto http;
         }
     }
    

    相关文章

      网友评论

          本文标题:gitlab优化禁用自带nginx和prometheus_mon

          本文链接:https://www.haomeiwen.com/subject/pklkbltx.html