Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ad1b85e

Browse files
forkbomberJoao Fernandes
authored andcommitted
Disable parameters substitution in heredoc
Signed-off-by: forkbomber <[email protected]>
1 parent 204051f commit ad1b85e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

registry/recipes/nginx.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Create the main nginx configuration you will use.
8383

8484
```
8585
86-
cat <<EOF > auth/nginx.conf
86+
cat > auth/nginx.conf << 'EOF'
8787
events {
8888
worker_connections 1024;
8989
}
@@ -99,7 +99,7 @@ http {
9999
## The registry always sets this header.
100100
## In the case of nginx performing auth, the header will be unset
101101
## 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 {
103103
'registry/2.0' '';
104104
default registry/2.0;
105105
}
@@ -127,7 +127,7 @@ http {
127127
location /v2/ {
128128
# Do not allow connections from docker 1.5 and earlier
129129
# 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 ).*$" ) {
131131
return 404;
132132
}
133133
@@ -137,13 +137,13 @@ http {
137137
138138
## If $docker_distribution_api_version is empty, the header will not be added.
139139
## 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;
141141
142142
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;
147147
proxy_read_timeout 900;
148148
}
149149
}

0 commit comments

Comments
 (0)