From bb6d02e0f62d7d3ca1e3eb1f1d454a40237a77f0 Mon Sep 17 00:00:00 2001 From: florian Date: Mon, 25 Jul 2022 16:13:34 +0200 Subject: [PATCH] examples - escape dollars in reverse-proxy-singlesite compose files --- docs/quickstart-guide.md | 35 +++++++++---------- .../reverse-proxy-singlesite/autoconf.yml | 8 ++--- .../docker-compose.yml | 4 +-- 3 files changed, 22 insertions(+), 25 deletions(-) diff --git a/docs/quickstart-guide.md b/docs/quickstart-guide.md index b5edd5bb4..1677cdc66 100644 --- a/docs/quickstart-guide.md +++ b/docs/quickstart-guide.md @@ -282,7 +282,7 @@ You will find more settings about reverse proxy in the [settings section](/1.4/s python3 -m http.server -b 127.0.0.1 ``` - Configuration of the `variables.env` file : + Content of the `my_variables.env` configuration file : ```conf SERVER_NAME=www.example.com HTTP_PORT=80 @@ -293,27 +293,24 @@ You will find more settings about reverse proxy in the [settings section](/1.4/s REVERSE_PROXY_HOST=http://127.0.0.1:8000 ``` - In your Ansible inventory, you can use the `variables_env` variable to configure BunkerWeb : + In your Ansible inventory, you can use the `variables_env` variable to set the path of configuration file : ```yaml - all: - children: - Groups: - hosts: - "Your_IP_Address": - vars: - variables_env: ../variables.env + [mybunkers] + 192.168.0.42 variables_env="{{ playbook_dir }}/my_variables.env" ``` + + Or alternatively, in your playbook file : + ```yaml + --- + - hosts: all + become: true + vars: + - variables_env: "{{ playbook_dir }}/my_variables.env" + roles: + - bunkerweb + ``` - Or in INI format : - ```ini - [all] - host - - [all:vars] - variables_env = ../variables.env - ``` - - Run the playbook : + You can now run the playbook : ```shell ansible-playbook -i inventory.yml playbook.yml ``` diff --git a/examples/reverse-proxy-singlesite/autoconf.yml b/examples/reverse-proxy-singlesite/autoconf.yml index dd3d5cb93..1f8ae64ca 100644 --- a/examples/reverse-proxy-singlesite/autoconf.yml +++ b/examples/reverse-proxy-singlesite/autoconf.yml @@ -16,8 +16,8 @@ services: - | bunkerweb.CUSTOM_CONF_SERVER_HTTP_redirects= port_in_redirect off; - location ~ ^/(app1|app2)$ { - rewrite ^(.*)$ $1/ permanent; + location ~ ^/(app1|app2)$$ { + rewrite ^(.*)$$ $$1/ permanent; } app2: @@ -34,8 +34,8 @@ services: - | bunkerweb.CUSTOM_CONF_SERVER_HTTP_redirects= port_in_redirect off; - location ~ ^/(app1|app2)$ { - rewrite ^(.*)$ $1/ permanent; + location ~ ^/(app1|app2)$$ { + rewrite ^(.*)$$ $$1/ permanent; } networks: diff --git a/examples/reverse-proxy-singlesite/docker-compose.yml b/examples/reverse-proxy-singlesite/docker-compose.yml index 0c942cfac..0a0c2e3e1 100644 --- a/examples/reverse-proxy-singlesite/docker-compose.yml +++ b/examples/reverse-proxy-singlesite/docker-compose.yml @@ -30,8 +30,8 @@ services: - | CUSTOM_CONF_SERVER_HTTP_redirects= port_in_redirect off; - location ~ ^/(app1|app2)$ { - rewrite ^(.*)$ $1/ permanent; + location ~ ^/(app1|app2)$$ { + rewrite ^(.*)$$ $$1/ permanent; }