This commit is contained in:
zino
2024-06-08 14:27:04 +02:00
parent 9c5ad3b512
commit 6993a5abfe

View File

@@ -33,13 +33,22 @@ server {
auth_basic_user_file /usr/share/nginx/html/registry.zinomedia.de/.htpasswd; auth_basic_user_file /usr/share/nginx/html/registry.zinomedia.de/.htpasswd;
location /v2/ { location /v2/ {
add_header Access-Control-Allow-Origin "https://registryui.zinomedia.de"; if ($request_method = OPTIONS) {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'Authorization, Accept, Cache-Control';
add_header 'Access-Control-Allow-Methods' 'HEAD, GET, OPTIONS, DELETE';
add_header 'Content-Length' '0';
add_header 'Content-Type' 'text/plain charset=UTF-8';
return 204;
}
add_header Access-Control-Allow-Origin "*";
add_header Access-Control-Allow-Credentials "true"; add_header Access-Control-Allow-Credentials "true";
add_header Access-Control-Allow-Headers "Authorization, Accept, Cache-Control"; add_header Access-Control-Allow-Headers "Authorization, Accept, Cache-Control";
add_header Access-Control-Allow-Methods "HEAD, GET, OPTIONS, DELETE"; add_header Access-Control-Allow-Methods "HEAD, GET, OPTIONS, DELETE";
# Do not allow connections from docker 1.5 and earlier # Do not allow connections from docker 1.5 and earlier
# docker pre-1.6.0 did not properly set the user agent on ping, catch "Go *" user agents
if ($http_user_agent ~ "^(docker\/1\.(3|4|5(?!\.[0-9]-dev))|Go ).*$" ) { if ($http_user_agent ~ "^(docker\/1\.(3|4|5(?!\.[0-9]-dev))|Go ).*$" ) {
return 404; return 404;
} }