Harbor always redirect to port 8080
This issue similar to https://github.com/goharbor/harbor/issues/10430 that was closed as stale, but problem actually
Expected behavior
If I request /v2 or /api URL it makes redirect to correct /v2/ and /api/, something like this
curl --verbose http://192.168.199.129/v2
* Trying 192.168.199.129:80...
* Connected to 192.168.199.129 (192.168.199.129) port 80 (#0)
> GET /v2 HTTP/1.1
> Host: 192.168.199.129
> User-Agent: curl/7.81.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 301 Moved Permanently
< Server: nginx
< Date: Wed, 27 Dec 2023 20:25:19 GMT
< Content-Type: text/html
< Content-Length: 162
< Location: http://192.168.199.129/v2/
< Connection: keep-alive
< X-Frame-Options: DENY
< Content-Security-Policy: frame-ancestors 'none'
<
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
* Connection #0 to host 192.168.199.129 left intact
Actual behavior: It redirects to :8080 port
curl --verbose --location http://192.168.199.129/v2
* Trying 192.168.199.129:80...
* Connected to 192.168.199.129 (192.168.199.129) port 80 (#0)
> GET /v2 HTTP/1.1
> Host: 192.168.199.129
> User-Agent: curl/7.81.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 301 Moved Permanently
< Server: nginx
< Date: Wed, 27 Dec 2023 20:40:15 GMT
< Content-Type: text/html
< Content-Length: 162
< Location: http://192.168.199.129:8080/v2/
< Connection: keep-alive
< X-Frame-Options: DENY
< Content-Security-Policy: frame-ancestors 'none'
<
* Ignoring the response-body
* Connection #0 to host 192.168.199.129 left intact
* Clear auth, redirects to port from 80 to 8080
* Issue another request to this URL: 'http://192.168.199.129:8080/v2/'
* Trying 192.168.199.129:8080...
* connect to 192.168.199.129 port 8080 failed: Connection refused
* Failed to connect to 192.168.199.129 port 8080 after 0 ms: Connection refused
* Closing connection 1
curl: (7) Failed to connect to 192.168.199.129 port 8080 after 0 ms: Connection refused
Steps to reproduce the problem: Install harbor by tutorial https://goharbor.io/docs/2.10.0/install-config/run-installer-script/
Versions:
- harbor version: v2.10.0-6abb4eab
- docker engine version: Docker version 24.0.5, build 24.0.5-0ubuntu1~22.04.1
- docker-compose version: Docker Compose version 2.20.2+ds1-0ubuntu1~22.04.1
Additional context:
- Harbor config files: Used default harbor.yml with change hostname and comment https section at all
diff harbor.yml.tmpl harbor.yml
5c5,6
< hostname: reg.mydomain.com
---
> #hostname: reg.mydomain.com
> hostname: 192.168.199.129
13c14
< https:
---
> #https:
15c16
< port: 443
---
> # port: 443
17,18c18,19
< certificate: /your/certificate/path
< private_key: /your/private/key/path
---
> # certificate: /your/certificate/path
> # private_key: /your/private/key/path
This issue is being marked stale due to a period of inactivity. If this issue is still relevant, please comment or remove the stale label. Otherwise, this issue will close in 30 days.
unstale please
We are also getting this exact same problem
This issue is being marked stale due to a period of inactivity. If this issue is still relevant, please comment or remove the stale label. Otherwise, this issue will close in 30 days.
unstale please
This issue is being marked stale due to a period of inactivity. If this issue is still relevant, please comment or remove the stale label. Otherwise, this issue will close in 30 days.