1. 配置 Harbor.yml 文件

harbor.yml 文件中修改 external_url 参数,设置为你的域名或 IP 地址。端口默认为 80。

# 修改 external_url 参数为你的域名或IP地址,端口默认为80
external_url: 'http://yourdomain.com'
  1. 配置 Nginx 代理

在 Nginx 的配置文件中添加以下内容:

server {
    listen 80;
    server_name yourdomain.com;

    location / {
        proxy_pass http://localhost:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

其中,yourdomain.com 为你的域名或 IP 地址,localhost:8080 为 Harbor 的监听地址,可以根据实际情况进行修改。

重启 Nginx 服务,即可通过访问 http://yourdomain.com 来访问 Harbor。

Harbor 配置外部访问:使用 Nginx 代理访问 8080 端口

原文地址: https://www.cveoy.top/t/topic/j8nf 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录