docker ps 查看已经安装好的gitlab,80,443端口也已经打开。
搭建好gitlab后,需要能让外网访问https访问到。
docker安装gitlab的时候,已经集成nginx只需要配置Nginx即可完成。
external_url 'https://gitlab.geexek.com.cn'
nginx['redirect_http_to_https'] = true
nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.geexek.com.cn.crt"
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.geexek.com.cn.key"
nginx['proxy_set_headers'] = {
"X-Forwarded-Proto" => "https",
"X-Forwarded-Ssl" => "on"
}
server {
listen *:443 ssl http2;
server_name gitlab.geexek.com.cn;
server_tokens off; ## Don't show the nginx version number, a security best practice
## Increase this if you want to upload large attachments
## Or if you want to accept large git objects over http
client_max_body_size 0;
## Strong SSL Security
## https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html & https://cipherli.st/
ssl on;
ssl_certificate /etc/gitlab/ssl/gitlab.geexek.com.cn.crt;
ssl_certificate_key /etc/gitlab/ssl/gitlab.geexek.com.cn.key;
}
版权说明 : 本文为转载文章, 版权归原作者所有 版权申明
原文链接 : https://blog.csdn.net/sunyuhua_keyboard/article/details/124901471
内容来源于网络,如有侵权,请联系作者删除!