goharbor / harbor

An open source trusted cloud native registry project that stores, signs, and scans content.

Home Page:https://goharbor.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use nginx to proxy harbor can lead to unexpect problem 

Linindoo opened this issue · comments

Is your feature request related to a problem? Please describe.
We use nginx to proxy harbor,the harbor is deploy at http and the nginx is over https,
when client request pull or push ,the harbor response fail with 401 code, and the response header Www-Authenticate content is like realm="http://<hostname>:<port>/service/token",so the client has to request the token over http

Describe the solution you'd like
I wish to config the realm url with harbor.yml

It's difficult to say what is wrong withou nginx configuration. Perhaps you are not routing locaion /service to the core component?

For start I would recommend looking at nginx configuration which is used by the official harbor helm chart:

It's difficult to say what is wrong withou nginx configuration. Perhaps you are not routing locaion /service to the core component?

For start I would recommend looking at nginx configuration which is used by the official harbor helm chart:

We use Gateway In front of harbor,so the harbor is just config by http, and the realm is always return the http url, we want to custom config the realm url but it was not support

The realm (service token url) is the same as <externalURL>/service/token, if you want to change it you could customize it in the harbor.yaml or values.yaml