@@ -83,7 +83,7 @@ Create the main nginx configuration you will use.
83
83
84
84
```
85
85
86
- cat <<EOF > auth/nginx.conf
86
+ cat > auth/nginx.conf << 'EOF'
87
87
events {
88
88
worker_connections 1024;
89
89
}
99
99
## The registry always sets this header.
100
100
## In the case of nginx performing auth, the header will be unset
101
101
## since nginx is auth-ing before proxying.
102
- map \ $upstream_http_docker_distribution_api_version \ $docker_distribution_api_version {
102
+ map $upstream_http_docker_distribution_api_version $docker_distribution_api_version {
103
103
'registry/2.0' '';
104
104
default registry/2.0;
105
105
}
@@ -127,7 +127,7 @@ http {
127
127
location /v2/ {
128
128
# Do not allow connections from docker 1.5 and earlier
129
129
# docker pre-1.6.0 did not properly set the user agent on ping, catch "Go *" user agents
130
- if (\ $http_user_agent ~ "^(docker\/1\.(3|4|5(?!\.[0-9]-dev))|Go ).*\ $" ) {
130
+ if ($http_user_agent ~ "^(docker\/1\.(3|4|5(?!\.[0-9]-dev))|Go ).*$" ) {
131
131
return 404;
132
132
}
133
133
@@ -137,13 +137,13 @@ http {
137
137
138
138
## If $docker_distribution_api_version is empty, the header will not be added.
139
139
## See the map directive above where this variable is defined.
140
- add_header 'Docker-Distribution-Api-Version' \ $docker_distribution_api_version always;
140
+ add_header 'Docker-Distribution-Api-Version' $docker_distribution_api_version always;
141
141
142
142
proxy_pass http://docker-registry;
143
- proxy_set_header Host \ $http_host; # required for docker client's sake
144
- proxy_set_header X-Real-IP \ $remote_addr; # pass on real client's IP
145
- proxy_set_header X-Forwarded-For \ $proxy_add_x_forwarded_for;
146
- proxy_set_header X-Forwarded-Proto \ $scheme;
143
+ proxy_set_header Host $http_host; # required for docker client's sake
144
+ proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP
145
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
146
+ proxy_set_header X-Forwarded-Proto $scheme;
147
147
proxy_read_timeout 900;
148
148
}
149
149
}
0 commit comments