• gitlab 变更代码库路径地址


    • nginx 的配置,设置的是浏览器打开的地址,和库地址不一定一致
    upstream gitlab {
      server unix:/var/opt/gitlab/gitlab-workhorse/socket;
    }
     
    server {
      listen *:80; 
      server_name gitlab.****.com;   # 请修改为你的域名
     
      server_tokens off;     # don't show the version number, a security best practice
      root /opt/gitlab/embedded/service/gitlab-rails/public;
     
      # Increase this if you want to upload large attachments
      # Or if you want to accept large git objects over http
      client_max_body_size 250m;
     
      # individual nginx logs for this gitlab vhost
      access_log  /var/log/gitlab/gitlab_access.log;
      error_log    /var/log/gitlab/gitlab_error.log;
     
      location / {
        # serve static files from defined root folder;.
        # @gitlab is a named location for the upstream fallback, see below
        try_files $uri $uri/index.html $uri.html @gitlab;
      }
     
      # if a file, which is not found in the root folder is requested,
      # then the proxy pass the request to the upsteam (gitlab unicorn)
      location @gitlab {
        # If you use https make sure you disable gzip compression 
        # to be safe against BREACH attack
     
        proxy_read_timeout 300; # Some requests take more than 30 seconds.
        proxy_connect_timeout 300; # Some requests take more than 30 seconds.
        proxy_redirect     off;
     
        proxy_set_header   X-Forwarded-Proto $scheme;
        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-Frame-Options   SAMEORIGIN;
     
        proxy_pass http://gitlab;
      }
     
      # Enable gzip compression as per rails guide: http://guides.rubyonrails.org/asset_pipeline.html#gzip-compression
      # WARNING: If you are using relative urls do remove the block below
      # See config/application.rb under "Relative url support" for the list of
      # other files that need to be changed for relative url support
      location ~ ^/(assets)/  {
        root /opt/gitlab/embedded/service/gitlab-rails/public;
        # gzip_static on; # to serve pre-gzipped version
        expires max;
        add_header Cache-Control public;
      }
     
      error_page 502 /502.html;
    }
    
    • vim /etc/gitlab/gitlab.rb
    • external_url 'http://gitlab.*****.com'
    • gitlab-ctl reconfigure 配置生效操作

      这修改的配置和图片地址相对应
    相信坚持的力量,日复一日的习惯.
  • 相关阅读:
    android平台从froyo 2.2开始支持jni单步调试
    Ubuntu java 环境变量
    ubuntu 10.04安装sunjava5jdk
    proc文件系统usb部分信息输出
    Linux lftp乱码解决及使用书签的方法
    用find & grep查找文件内容
    ubuntu10.10 下安装android 2.2开发环境
    VIM复制粘贴大全!
    kinect 无法在我的android开发板上显示的分析
    hdu 1087 Super Jumping! Jumping! Jumping!
  • 原文地址:https://www.cnblogs.com/pansidong/p/15119953.html
Copyright © 2020-2023  润新知