配置阿里云+域名真实环境,访问不了
来源:2-3 GitLab安装配置管理

smniuhe
2020-07-09
环境阿里云ECS, centos7.3 2核4G,所有配置方式都是参考视频,
域名是 smniuhe.com,可以ping 通,有个疑问是可以配置子域名么,这边并不能ping 通 gitlab.smniuhe.com,gitlab-ctl restart 启动服务后,访问不了 gitlab.smniuhe.com 这个地址,老师需要查看我这边什么配置随时发信息
#将所有证书配置到gitlab文件中
[root@iZuf6iq8e7ya9v3ix71k0pZ ssl]# vim /etc/gitlab/gitlab.rb
external_url = 'https://gitlab.smniuhe.com'
nginx['redirect_http_to_https'] = true
# nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.smniuhe.com.crt"
# nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.smniuhe.com.key"
# nginx['ssl_dhparam'] = /etc/gitlab/ssl/dhparams.pem # Path to dhparams.pem, eg. /etc/gitlab/ssl/dhparams.pem
# 配置 nginx 转发
[root@iZuf6iq8e7ya9v3ix71k0pZ ssl]# vim /var/opt/gitlab/nginx/conf/gitlab-http.conf
server {
listen *:80;
server_name gitlab.smniuhe.com;
rewrite ^(.*)$ https://$host$1 permanent;
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;
vim /var/opt/gitlab/gitlab-rails/etc/gitlab.yml
#
# 1. GitLab app settings
# ==========================
## GitLab settings
gitlab:
## Web server settings (note: host is the FQDN, do not include http://)
host: 106.15.191.27
port: 80
https: false
写回答
6回答
-
一路向北
2020-07-10
如果你配置了证书 那就应该开启443端口,而且这里我看不到gitlab的关键配置项,从最新日志我又看到了一个占用了8080端口的错误
062020-07-11 -
一路向北
2020-07-10
建议把完整的配置文件发过来,还有为什么你的nginx要启动80端口?
012020-07-10 -
smniuhe
提问者
2020-07-10
这是解决 80 冲突后的日志,没看到相关异常,gitlab.smniuhe.com 还是访问不了
00 -
一路向北
2020-07-10
从日志看的确80端口被占用,首先确保你的机器上没有其他服务使用80端口
022020-07-10 -
smniuhe
提问者
2020-07-10
sudo gitlab-clt tail 查看运行日志
00 -
一路向北
2020-07-10
感谢这位同学关注,可以查看一下gitlab日志看有什么报错信息,并且确保你的云主机已经做了备案,否则公网访问80 443端口可能会被运营商禁端口。
022020-07-10
相似问题