bunkerweb 1.4.0
This commit is contained in:
6
examples/swarm-configs/all-server-http.conf
Normal file
6
examples/swarm-configs/all-server-http.conf
Normal file
@@ -0,0 +1,6 @@
|
||||
location /hello {
|
||||
default_type "text/plain";
|
||||
content_by_lua_block {
|
||||
ngx.say("hello")
|
||||
}
|
||||
}
|
||||
6
examples/swarm-configs/app1-server-http.conf
Normal file
6
examples/swarm-configs/app1-server-http.conf
Normal file
@@ -0,0 +1,6 @@
|
||||
location /app1 {
|
||||
default_type "text/plain";
|
||||
content_by_lua_block {
|
||||
ngx.say("app1")
|
||||
}
|
||||
}
|
||||
6
examples/swarm-configs/app2-server-http.conf
Normal file
6
examples/swarm-configs/app2-server-http.conf
Normal file
@@ -0,0 +1,6 @@
|
||||
location /app2 {
|
||||
default_type "text/plain";
|
||||
content_by_lua_block {
|
||||
ngx.say("app2")
|
||||
}
|
||||
}
|
||||
6
examples/swarm-configs/app3-server-http.conf
Normal file
6
examples/swarm-configs/app3-server-http.conf
Normal file
@@ -0,0 +1,6 @@
|
||||
location /app3 {
|
||||
default_type "text/plain";
|
||||
content_by_lua_block {
|
||||
ngx.say("app3")
|
||||
}
|
||||
}
|
||||
19
examples/swarm-configs/setup.sh
Executable file
19
examples/swarm-configs/setup.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
# docker-compose doesn't support assigning labels to configs
|
||||
# so we need to create the configs with the CLI
|
||||
# bunkerweb.CONFIG_TYPE accepted values are http, stream, server-http, server-stream, default-server-http, modsec and modsec-crs
|
||||
# bunkerweb.CONFIG_SITE lets you choose on which web service the config should be applied (MULTISITE mode) and if it's not set, the config will be applied for all services
|
||||
# more info at https://docs.bunkerweb.io
|
||||
|
||||
# remove configs if existing
|
||||
docker config rm cfg_all_server_http
|
||||
docker config rm cfg_app1_server_http
|
||||
docker config rm cfg_app2_server_http
|
||||
docker config rm cfg_app3_server_http
|
||||
|
||||
# create configs
|
||||
docker config create -l bunkerweb.CONFIG_TYPE=server-http cfg_all_server_http ./all-server-http.conf
|
||||
docker config create -l bunkerweb.CONFIG_TYPE=server-http -l bunkerweb.CONFIG_SITE=app1.example.com cfg_app1_server_http ./app1-server-http.conf
|
||||
docker config create -l bunkerweb.CONFIG_TYPE=server-http -l bunkerweb.CONFIG_SITE=app2.example.com cfg_app2_server_http ./app2-server-http.conf
|
||||
docker config create -l bunkerweb.CONFIG_TYPE=server-http -l bunkerweb.CONFIG_SITE=app3.example.com cfg_app3_server_http ./app3-server-http.conf
|
||||
50
examples/swarm-configs/stack.yml
Normal file
50
examples/swarm-configs/stack.yml
Normal file
@@ -0,0 +1,50 @@
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
|
||||
myapp1:
|
||||
image: tutum/hello-world
|
||||
networks:
|
||||
- bw-services
|
||||
deploy:
|
||||
placement:
|
||||
constraints:
|
||||
- "node.role==worker"
|
||||
labels:
|
||||
- "bunkerweb.SERVER_NAME=app1.example.com"
|
||||
- "bunkerweb.USE_REVERSE_PROXY=yes"
|
||||
- "bunkerweb.REVERSE_PROXY_URL=/"
|
||||
- "bunkerweb.REVERSE_PROXY_HOST=http://myapp1"
|
||||
|
||||
myapp2:
|
||||
image: tutum/hello-world
|
||||
networks:
|
||||
- bw-services
|
||||
deploy:
|
||||
placement:
|
||||
constraints:
|
||||
- "node.role==worker"
|
||||
labels:
|
||||
- "bunkerweb.SERVER_NAME=app2.example.com"
|
||||
- "bunkerweb.USE_REVERSE_PROXY=yes"
|
||||
- "bunkerweb.REVERSE_PROXY_URL=/"
|
||||
- "bunkerweb.REVERSE_PROXY_HOST=http://myapp2"
|
||||
|
||||
myapp3:
|
||||
image: tutum/hello-world
|
||||
networks:
|
||||
- bw-services
|
||||
deploy:
|
||||
placement:
|
||||
constraints:
|
||||
- "node.role==worker"
|
||||
labels:
|
||||
- "bunkerweb.SERVER_NAME=app3.example.com"
|
||||
- "bunkerweb.USE_REVERSE_PROXY=yes"
|
||||
- "bunkerweb.REVERSE_PROXY_URL=/"
|
||||
- "bunkerweb.REVERSE_PROXY_HOST=http://myapp3"
|
||||
|
||||
networks:
|
||||
bw-services:
|
||||
external:
|
||||
name: bw-services
|
||||
Reference in New Issue
Block a user