examples - escape dollars in reverse-proxy-singlesite compose files

This commit is contained in:
florian 2022-07-25 16:13:34 +02:00
parent 5c42fb58d7
commit bb6d02e0f6
3 changed files with 22 additions and 25 deletions

View file

@ -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 python3 -m http.server -b 127.0.0.1
``` ```
Configuration of the `variables.env` file : Content of the `my_variables.env` configuration file :
```conf ```conf
SERVER_NAME=www.example.com SERVER_NAME=www.example.com
HTTP_PORT=80 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 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 ```yaml
all: [mybunkers]
children: 192.168.0.42 variables_env="{{ playbook_dir }}/my_variables.env"
Groups:
hosts:
"Your_IP_Address":
vars:
variables_env: ../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 : You can now run the playbook :
```ini
[all]
host
[all:vars]
variables_env = ../variables.env
```
Run the playbook :
```shell ```shell
ansible-playbook -i inventory.yml playbook.yml ansible-playbook -i inventory.yml playbook.yml
``` ```

View file

@ -16,8 +16,8 @@ services:
- | - |
bunkerweb.CUSTOM_CONF_SERVER_HTTP_redirects= bunkerweb.CUSTOM_CONF_SERVER_HTTP_redirects=
port_in_redirect off; port_in_redirect off;
location ~ ^/(app1|app2)$ { location ~ ^/(app1|app2)$$ {
rewrite ^(.*)$ $1/ permanent; rewrite ^(.*)$$ $$1/ permanent;
} }
app2: app2:
@ -34,8 +34,8 @@ services:
- | - |
bunkerweb.CUSTOM_CONF_SERVER_HTTP_redirects= bunkerweb.CUSTOM_CONF_SERVER_HTTP_redirects=
port_in_redirect off; port_in_redirect off;
location ~ ^/(app1|app2)$ { location ~ ^/(app1|app2)$$ {
rewrite ^(.*)$ $1/ permanent; rewrite ^(.*)$$ $$1/ permanent;
} }
networks: networks:

View file

@ -30,8 +30,8 @@ services:
- | - |
CUSTOM_CONF_SERVER_HTTP_redirects= CUSTOM_CONF_SERVER_HTTP_redirects=
port_in_redirect off; port_in_redirect off;
location ~ ^/(app1|app2)$ { location ~ ^/(app1|app2)$$ {
rewrite ^(.*)$ $1/ permanent; rewrite ^(.*)$$ $$1/ permanent;
} }