Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supports custom headers when the ui is used as proxy #89

Merged
merged 2 commits into from
Jul 2, 2019
Merged

Conversation

Joxit
Copy link
Owner

@Joxit Joxit commented Jun 30, 2019

Background

Headers can be useful in some cases such as avoid sending credentials when you are on the UI (like #87). Or give to the registry server other properties such as X-Forward-For or Server headers for monitoring.

How to use ?

This is compatible only with static version of the UI and used with REGISTRY_URL variable.
When you want to add a custom header, add to the registry ui a environment variable or entry in /etc/nginx/.env which looks like NGINX_PROXY_HEADER_Custom_Header. All underscores (_) will be replaced by hyphens (-).

Some example of custom headers as variable:

  • NGINX_PROXY_HEADER_Authorization for Basic auth credentials
  • NGINX_PROXY_HEADER_X_Forwarded_For for identifying the originating IP address of a client

An example is bundled with this PR

Any feedback @marcusblake ?

closes: #87

@Joxit
Copy link
Owner Author

Joxit commented Jun 30, 2019

I can also add a supports for custom headers from a file, like you did in #87 and this will supersede your PR

@marcusblake
Copy link

This is great! I believe adding support for custom headers from files (especially credentials) would be a great feature to add as well.

Remove the print of headers for security
@Joxit Joxit merged commit 7777ff2 into master Jul 2, 2019
@Joxit Joxit deleted the custom-headers branch July 2, 2019 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants