【发布时间】:2021-12-14 00:19:23
【问题描述】:
我已经配置了 gitlab,所以我只能从特定的 IP 地址连接到它。在 gitlab.rb 文件中,我以这种方式配置了 url:
external_url 'gitlab.example.pl:2000'
还配置了ufw:
[ 1] 2000 ALLOW IN 192.169.0.1/24
当我想通过浏览器访问 gitlab 时,我必须额外输入端口 2000,所以我想将端口转发到 443。我不能只对 ufw 中的特定 IP 地址访问端口 443,因为我配置了最重要的在同一台服务器中,并且必须从任何地方访问。我尝试使用 apache2 或 ngnix 进行端口转发,但 gitlab 侦听端口 80,因此 apache2 和 nginx 无法正常工作。我也尝试在文件 gitlab.rb 中找到解决方案
nginx['listen_port'] = 443
nginx['redirect_http_to_https_port'] = 80
nginx['redirect_http_to_https'] = false
请给我一个解决这个问题的方法。
【问题讨论】:
标签: linux gitlab portforwarding mattermost