gitlab开启https加密 and 全站https
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了gitlab开启https加密 and 全站https相关的知识,希望对你有一定的参考价值。
建立SSL目录, 然后拷贝你的证书到SSL目录:
# mkdir /etc/gitlab/ssl # chmod 700 /etc/gitlab/ssl # cp luck.crt luck.key /etc/gitlab/ssl/
编辑/etc/gitlab/gitlab.rb文件, 修改成:
external_url "https://www.abc.com" nginx[‘redirect_http_to_https‘] = true nginx[‘ssl_certificate‘] = "/etc/gitlab/ssl/luck.crt" nginx[‘ssl_certificate_key‘] = "/etc/gitlab/ssl/luck.key"
之后使用gitlab-ctl reconfigure重建配置, 再修改Nginx配置文件/var/opt/gitlab/nginx/conf/gitlab-http.conf里的默认设置:
listen *:443 default_server; ssl on; ssl_certificate /etc/gitlab/ssl/luck.crt; ssl_certificate_key /etc/gitlab/ssl/luck.key;
接着再创建一个/var/opt/gitlab/nginx/conf/index.conf文件用来HTTP跳转HTTPS:
server { listen *:80; server_name www.abc.com; rewrite ^(.*)$ https://$host$1 permanent; }
最后修改/var/opt/gitlab/nginx/etc/nginx.conf配置文件, 在其中加入以下内容, 来载入index.conf:
include /var/opt/gitlab/nginx/conf/index.conf; include /var/opt/gitlab/nginx/conf/gitlab-http.conf;
以上全部完成之后, 使用gitlab-ctl restart来重启所有服务, 即可使用HTTPS访问GitLab了.
eclipse 客户端导入项目报错
SSL host could not be verified (set http.sslVerify=false in Git configuration)
打开eclipse
Window --> preferences --> configuration --> add entry
本文出自 “停止奋斗=停止生命” 博客,请务必保留此出处http://53cto.blog.51cto.com/9899631/1775865
以上是关于gitlab开启https加密 and 全站https的主要内容,如果未能解决你的问题,请参考以下文章