Artifactory 和 NGINX 的问题 proxy_pass

Issues with Artifactory and NGINX proxy_pass

我在使用 nginx 和代理通行证时遇到问题。我已经设置了一个 JFrog Artifactory 实例并成功地将我的域指向它;但是该端口仍出现在“URL 文件”(the image) 中。这是我的 nginx 配置

server {
  
server_name repo.hyperiamc.com;

if ($http_x_forwarded_proto = '') {
    set $http_x_forwarded_proto  $scheme;
}
## Application specific logs
rewrite ^/$ /ui/ redirect;
rewrite ^/ui$ /ui/ redirect;
chunked_transfer_encoding on;
client_max_body_size 0;
location / {
    proxy_read_timeout  2400s;
    proxy_pass_header   Server;
    proxy_cookie_path   ~*^/.* /;
    proxy_pass          http://x.x.x.x:8082;
    proxy_next_upstream error timeout non_idempotent;
    proxy_next_upstream_tries    1;
    proxy_set_header    X-JFrog-Override-Base-Url $http_x_forwarded_proto://$host:$server_port;
    proxy_set_header    X-Forwarded-Port  $server_port;
    proxy_set_header    X-Forwarded-Proto $http_x_forwarded_proto;
    proxy_set_header    Host              $http_host;
    proxy_set_header    X-Forwarded-For   $proxy_add_x_forwarded_for;

    location ~ ^/artifactory/ {
        proxy_pass    http://x.x.x.x:8081;
    }
}

listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/repo.hyperiamc.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/repo.hyperiamc.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot }

访问 URL 工作的网站,似乎只有 URL 要归档。我已经在 artifactory 中设置了我的 Base URL 以匹配代理的 Base

我认为这是由于我们在配置中设置的 header 值所致。换线。 来自:proxy_set_header X-JFrog-Override-Base-Url $http_x_forwarded_proto://$host:$server_port;

收件人:proxy_set_header X-JFrog-Override-Base-Url $http_x_forwarded_proto://$host;

希望对您有所帮助。