mirror of
https://github.com/bunkerity/bunkerized-nginx
synced 2023-12-13 21:30:18 +01:00
examples - escape dollars in reverse-proxy-singlesite compose files
This commit is contained in:
parent
5c42fb58d7
commit
bb6d02e0f6
|
@ -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
|
||||||
```
|
```
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue