From 283f61e866dc6e0417b7a054d25799f123a338c0 Mon Sep 17 00:00:00 2001 From: Konstantin Demin Date: Tue, 1 Oct 2024 09:09:35 +0300 Subject: [PATCH] doc: correct "config-template" example --- doc/examples/config-template/README.md | 9 ++------- .../config-template/conf/image-entry/80-my-caches.envsh | 3 +-- .../config-template/conf/site/http-my-cache.conf.j2 | 4 +--- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/doc/examples/config-template/README.md b/doc/examples/config-template/README.md index 1d460ee..e236808 100644 --- a/doc/examples/config-template/README.md +++ b/doc/examples/config-template/README.md @@ -3,11 +3,6 @@ configuration: ```nginx -map $uri $to_proxy_uri -{ - ~^/[^/]+/(.*)$ $1; -} - {%- for h in (j2cfg.my_caches or []) %} proxy_cache_path /angie/my-cache/{{ h.name }} @@ -22,7 +17,7 @@ server { {%- for h in (j2cfg.my_caches or []) %} location /{{ h.name }}/ { - proxy_pass {{ h.uri }}/$to_proxy_uri$is_args$args; + proxy_pass {{ h.uri }}/; proxy_cache {{ h.name }}; @@ -91,7 +86,7 @@ server { # ... location /proxy_apt_debian/ { - proxy_pass https://deb.debian.org/debian/$to_proxy_uri$is_args$args; + proxy_pass https://deb.debian.org/debian/; proxy_cache proxy_apt_debian; diff --git a/doc/examples/config-template/conf/image-entry/80-my-caches.envsh b/doc/examples/config-template/conf/image-entry/80-my-caches.envsh index 3e06ee8..b0edd26 100755 --- a/doc/examples/config-template/conf/image-entry/80-my-caches.envsh +++ b/doc/examples/config-template/conf/image-entry/80-my-caches.envsh @@ -1,8 +1,7 @@ #!/bin/sh unset d -d="${target_root}/cache/my-cache" -[ -d "$d" ] || install_userdir "$d" +d="/angie/my-cache" unset p while read -r p ; do diff --git a/doc/examples/config-template/conf/site/http-my-cache.conf.j2 b/doc/examples/config-template/conf/site/http-my-cache.conf.j2 index 63a054f..2199e45 100644 --- a/doc/examples/config-template/conf/site/http-my-cache.conf.j2 +++ b/doc/examples/config-template/conf/site/http-my-cache.conf.j2 @@ -1,8 +1,6 @@ map $uri $to_proxy_uri { - volatile; - ~^/[^/]+/(.*)$ $1; } @@ -68,7 +66,7 @@ server { {%- for h in (j2cfg.my_caches or []) %} location /{{ h.name }}/ { - proxy_pass {{ h.uri }}/$to_proxy_uri$is_args$args; + proxy_pass {{ h.uri }}/; proxy_cache {{ h.name }};