forked from ContainerSolutions/docker-registry-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.conf
30 lines (24 loc) · 915 Bytes
/
default.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
server {
listen 443 ssl;
server_name {{SERVER_NAME}};
add_header Docker-Distribution-Api-Version: registry/2.0 always;
ssl on;
ssl_certificate /etc/nginx/ssl/docker-registry.crt;
ssl_certificate_key /etc/nginx/ssl/docker-registry.key;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Original-URI $request_uri;
proxy_set_header Docker-Distribution-Api-Version registry/2.0;
client_max_body_size 0; # disable any limits to avoid HTTP 413 for large image uploads
location / {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
proxy_pass http://{{REGISTRY_HOST}}:{{REGISTRY_PORT}};
}
location /v1/_ping {
auth_basic off;
return 200 'V2 registry';
}
}