Last active
October 20, 2020 11:54
-
-
Save bloodearnest/dbc5295eaec80d638da68c423123187f to your computer and use it in GitHub Desktop.
Proxy ghcr.io with auth realm rewrite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map $upstream_http_www_authenticate $auth_header { | |
~(.*)ghcr.io(.*) $1example.com$2; | |
} | |
server { | |
server_name example.com | |
... | |
location / { | |
limit_except GET { deny all; } | |
proxy_pass https://ghcr.io; | |
proxy_hide_header www-authenticate; | |
add_header www-authenticate $auth_header always; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment