要在外网访问Harbor私服,您需要进行以下配置:
- 修改Harbor的配置文件(harbor.yml)中的hostname:将hostname配置为您的公网IP或域名。例如:
- 在配置文件中设置external_url:将external_url设置为您的公网IP或域名。确保在URL中包含正确的协议(http或https)。例如:
external_url: http://公网IP或域名
- 配置Harbor所在服务器的防火墙:确保您的服务器的防火墙允许外部对Harbor所使用的端口(默认为80和443)的访问。您可能需要在防火墙规则中添加入站规则来允许流量通过这些端口。
- 配置路由器或网络设备:如果您使用了路由器或其他网络设备来连接到互联网,请确保正确配置端口转发规则,将您的公网IP与Harbor服务器的内部IP地址和端口进行映射。
请注意,如果您使用的是http而不是https协议,数据传输将是明文的,因此建议在公网上使用https。为了启用https,您需要使用有效的SSL证书,并将SSL证书的相关配置添加到Harbor的配置文件中。
此外,关于Harbor的nginx配置,Harbor已经自带了两个nginx(ui和registry),您不需要额外配置第三个nginx。proxy段是用于配置反向代理的,如果您的Harbor服务后面有其他代理服务器,您可以根据需要进行配置。
完成以上步骤后,保存配置文件并重新启动Harbor服务,然后您应该能够在公网上通过您的公网IP或域名访问Harbor私服。
如果您仍然遇到问题,请提供任何错误或警告信息,以便更详细地分析和解决问题。
Harbor 是一个开源的容器镜像仓库,用于存储和管理 Docker 镜像和其他容器镜像。 * 容器镜像仓库、存储和管理 Docker 镜像和其他容器镜像 * 有什么特点:支持多种镜像格式、易于使用、安全性和访问控制
最近提交(Master分支:5 个月前 )
42f86f8c
Bumps [helm.sh/helm/v3](https://github.com/helm/helm) from 3.16.2 to 3.17.0.
- [Release notes](https://github.com/helm/helm/releases)
- [Commits](https://github.com/helm/helm/compare/v3.16.2...v3.17.0)
---
updated-dependencies:
- dependency-name: helm.sh/helm/v3
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: miner <yminer@vmware.com> 2 天前
db017f0d
chore(deps): bump github.com/volcengine/volcengine-go-sdk in /src
Bumps [github.com/volcengine/volcengine-go-sdk](https://github.com/volcengine/volcengine-go-sdk) from 1.0.177 to 1.0.180.
- [Release notes](https://github.com/volcengine/volcengine-go-sdk/releases)
- [Commits](https://github.com/volcengine/volcengine-go-sdk/compare/v1.0.177...v1.0.180)
---
updated-dependencies:
- dependency-name: github.com/volcengine/volcengine-go-sdk
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: miner <yminer@vmware.com> 2 天前
旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。
所有评论(0)