1
0

doc: correct "config-template" example

This commit is contained in:
Konstantin Demin 2024-10-01 09:09:35 +03:00
parent fd803b76e1
commit 283f61e866
Signed by: krd
GPG Key ID: 4D56F87A8BA65FD0
3 changed files with 4 additions and 12 deletions

View File

@ -3,11 +3,6 @@
configuration: configuration:
```nginx ```nginx
map $uri $to_proxy_uri
{
~^/[^/]+/(.*)$ $1;
}
{%- for h in (j2cfg.my_caches or []) %} {%- for h in (j2cfg.my_caches or []) %}
proxy_cache_path proxy_cache_path
/angie/my-cache/{{ h.name }} /angie/my-cache/{{ h.name }}
@ -22,7 +17,7 @@ server {
{%- for h in (j2cfg.my_caches or []) %} {%- for h in (j2cfg.my_caches or []) %}
location /{{ h.name }}/ { location /{{ h.name }}/ {
proxy_pass {{ h.uri }}/$to_proxy_uri$is_args$args; proxy_pass {{ h.uri }}/;
proxy_cache {{ h.name }}; proxy_cache {{ h.name }};
@ -91,7 +86,7 @@ server {
# ... # ...
location /proxy_apt_debian/ { 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; proxy_cache proxy_apt_debian;

View File

@ -1,8 +1,7 @@
#!/bin/sh #!/bin/sh
unset d unset d
d="${target_root}/cache/my-cache" d="/angie/my-cache"
[ -d "$d" ] || install_userdir "$d"
unset p unset p
while read -r p ; do while read -r p ; do

View File

@ -1,8 +1,6 @@
map $uri map $uri
$to_proxy_uri $to_proxy_uri
{ {
volatile;
~^/[^/]+/(.*)$ $1; ~^/[^/]+/(.*)$ $1;
} }
@ -68,7 +66,7 @@ server {
{%- for h in (j2cfg.my_caches or []) %} {%- for h in (j2cfg.my_caches or []) %}
location /{{ h.name }}/ { location /{{ h.name }}/ {
proxy_pass {{ h.uri }}/$to_proxy_uri$is_args$args; proxy_pass {{ h.uri }}/;
proxy_cache {{ h.name }}; proxy_cache {{ h.name }};