文章目录
公司内部Gitlab的端口是10080,Chrome访问这个端口会报错:ERR_UNSAFE_PORT
这种情况下就比较恶心了,为了解决这个问题,我找了两种方法来解决:
修改启动参数
通过修改启动Chrome的参数,在启动时增加允许不安全端口的访问
打开Mac的终端执行
1 | cd "/Applications/Google Chrome.app/Contents/MacOS/" |
1 | sudo printf '#!/bin/bash\ncd "/Applications/Google Chrome.app/Contents/MacOS"\n"/Applications/Google Chrome.app/Contents/MacOS/Google.real" --explicitly-allowed-ports=10080,6000 "$@"\n' > Google\ Chrome |
执行后,重启浏览器重新访问会惊奇的发现已经可以访问~
但是通过这种方法修改后,重启mac,chrome则会有打不开的情况,至今未找到解决方法,为此,可参考第二种方法来解决
使用反向代理
可以尝试在mac中安装一个nginx来返代访问gitlab,具体配置如下:
1 | server{ |