From 8149893423cda8d425c0bdb06a7bf3897b0a6c3d Mon Sep 17 00:00:00 2001 From: forkbomber Date: Fri, 23 Sep 2016 20:34:55 +0000 Subject: [PATCH] Disable parameters substitution in heredoc Signed-off-by: forkbomber --- docs/recipes/nginx.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/recipes/nginx.md b/docs/recipes/nginx.md index 59f2fabf1..89a5834ec 100644 --- a/docs/recipes/nginx.md +++ b/docs/recipes/nginx.md @@ -83,7 +83,7 @@ Create the main nginx configuration you will use. ``` -cat < auth/nginx.conf +cat > auth/nginx.conf << 'EOF' events { worker_connections 1024; } @@ -99,7 +99,7 @@ http { ## The registry always sets this header. ## In the case of nginx performing auth, the header will be unset ## since nginx is auth-ing before proxying. - map \$upstream_http_docker_distribution_api_version \$docker_distribution_api_version { + map $upstream_http_docker_distribution_api_version $docker_distribution_api_version { 'registry/2.0' ''; default registry/2.0; } @@ -127,7 +127,7 @@ http { location /v2/ { # 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; } @@ -137,13 +137,13 @@ http { ## If $docker_distribution_api_version is empty, the header will not be added. ## See the map directive above where this variable is defined. - add_header 'Docker-Distribution-Api-Version' \$docker_distribution_api_version always; + add_header 'Docker-Distribution-Api-Version' $docker_distribution_api_version always; proxy_pass http://docker-registry; - proxy_set_header Host \$http_host; # required for docker client's sake - proxy_set_header X-Real-IP \$remote_addr; # pass on real client's IP - proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto \$scheme; + proxy_set_header Host $http_host; # required for docker client's sake + proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; proxy_read_timeout 900; } }