【发布时间】:2020-04-08 15:10:24
【问题描述】:
我想通过与 gitlab 的连接使用 https。
我执行了
openssl req -x509 -sha256 -days 365 -nodes -newkey rsa:2048 -keyout /etc/gitlab/ssl/172.29.128.166.key -out /etc/gitlab/ssl/172.29.128.166.crt
我的 gitlab.rb 如下
external_url "https://172.29.128.166:8929/"
nginx['enable'] = true
nginx['redirect_http_to_https'] = true
nginx['redirect_http_to_https_port'] = 80
nginx['ssl_certificate'] = "/etc/gitlab/ssl/172.29.128.166.crt"
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/172.29.128.166.key"
2 个问题:
1) 当我去http://172.29.128.166:8929/时,我得到了
400 Bad Request
The plain HTTP request was sent to HTTPS port
nginx
我已经指定了nginx['redirect_http_to_https'] = true,所以它不应该转到https吗?
2) 当我转到https://172.29.128.166:8929/ 时,我可以查看 GitLab。但是,我的 chrome 说它是“不安全的”。 我也可以看到证书无效。
我该如何解决这个问题?我是新手,谢谢
【问题讨论】: