bunkerweb 1.4.0

This commit is contained in:
bunkerity
2022-06-03 17:24:14 +02:00
parent 3a078326c5
commit a9f886804a
5245 changed files with 1432051 additions and 27894 deletions

View File

@@ -0,0 +1,6 @@
location /hello {
default_type "text/plain";
content_by_lua_block {
ngx.say("hello")
}
}

View File

@@ -0,0 +1,6 @@
location /app1 {
default_type "text/plain";
content_by_lua_block {
ngx.say("app1")
}
}

View File

@@ -0,0 +1,6 @@
location /app2 {
default_type "text/plain";
content_by_lua_block {
ngx.say("app2")
}
}

View 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
View 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

View 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