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.
Read More:
- [Solved] Playbook Start Nginx Error: Unable to start service nginx: Job for nginx.service fd with error code
- [Solved] Docker Start nginx error: driver failed programming external connectivity on endpoint nginx
- Gitlab Reconfigure is Stuck ruby_block[wait for redis service socket] action run
- Nginx Container Error: nginx: [emerg] mkdir() “/var/cache/nginx/client_temp“ failed (13: Permission denied)
- Gitlab Clone Error: next InitializeSecurityContext failed
- [Nginx] Configure nginx to support websocket to solve the problem of returning 400 error
- [Solved] Windows Nginx Startup Error: bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket
- Docker Create or Start Nginx Error: docker: Error response from daemon: driver failed programming external connectivity
- hint: Updates were rejected because the remote contains work that you do To XXX
- How to Solve Nginx 413 Error (request entity too large)
- Nginx: How to Use Error_Page
- Keras’ print model error: Failed to import pydot. You must install pydot and graphviz for `pydotprint` to work.
- [Solved] Springboot project Create to start Error: APPLICATION FAILED TO START
- [Solved] integrated swagger Start Error: Failed to start bean ‘documentationPluginsBootstrapper‘;
- VTK GetScalarPointer() and GetScalarComponentAsFloat() not work
- [Solved] Error(22) WARNING: IPv4 forwarding is disabled. Networking will not work.
- [Solved] jumpserver nginx Error: Connect websocket server error
- How to Solve Nginx cross compilation Error
- Android studio can’t start, running error: warning: crash service did not start
- An error occurred: Sorry,Faithfully yours, nginx Error