conclusion
- I got this problem as well. and now I’ve solved it.
solution
I’ve modified the /etc/gitlab/gitlab.rb file, changed into
nginx[‘redirect_http_to_https_port’] = 80 nginx[‘listen_port’] = 443
and sudo gitlab-ctl reconfigure + sudo gitlab-ctl restart, and it works.
process
in the past, the reason i could connect to gitlab server is because that my colleague have set something in the /var/opt/gitlab/nginx/conf/gitlab-http.conf file.
Redirects all HTTP traffic to the HTTPS host
server {
listen *:80;
server_name gitlab.xxxxx.com;
server_tokens off; ## Don't show the nginx version number, a security best practice
location / {
return 301 https://gitlab.xxxxxx.com:443$request_uri;
}
# health checks configuration
include /var/opt/gitlab/nginx/conf/gitlab-health.conf;
access_log /var/log/gitlab/nginx/gitlab_access.log gitlab_access;
error_log /var/log/gitlab/nginx/gitlab_error.log;
}
server {
listen *:443 ssl http2;
server_name gitlab.xxxxxx.com;
server_tokens off; ## Don't show the nginx version number, a security best practice
-
and once if I’ve use the command sudo gitlab-ctl reconfigure, and the file gitlab-http.conf would be covered by /etc/gitlab/gitlab.rb. and the nginx settings in /etc/gitlab/gitlab.rb would start to take position that makes me cannot visit gitlab server after using the command sudo gitlab-ctl reconfigure. -
and now I’ve set the nginx settings right in /etc/gitlab/gitlab.rb just like in the solution part. -
hope it could help. thx. -
回复在gitlab的官方相关讨论中,所以是英文回复。 不打算重新用中文写一遍了。 直接搬迁过来。 -
gitlab 链接
|