File tree Expand file tree Collapse file tree 6 files changed +48
-4
lines changed Expand file tree Collapse file tree 6 files changed +48
-4
lines changed Original file line number Diff line number Diff line change 6
6
7
7
RUN apt-get update \
8
8
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
9
- nodejs npm git openssh-client \
9
+ nodejs npm git openssh-client telnet \
10
10
squid \
11
11
nginx \
12
12
trafficserver \
13
13
apache2 \
14
14
varnish \
15
+ golang \
15
16
&& rm -rf /var/lib/apt/lists/* \
16
17
&& apt-get clean
17
18
@@ -61,6 +62,13 @@ EXPOSE 8004
61
62
EXPOSE 8005
62
63
63
64
65
+ # caddy
66
+
67
+ RUN go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
68
+ RUN ~/go/bin/xcaddy build --with github.com/caddyserver/cache-handler
69
+ COPY caddy/Caddyfile /etc/caddy/Caddyfile
70
+ EXPOSE 8006
71
+
64
72
# setup
65
73
66
74
COPY setup.sh /sbin/setup.sh
Original file line number Diff line number Diff line change @@ -14,4 +14,3 @@ To add a new reverse proxy:
14
14
4 . In ` serve.sh ` , start the server in the background
15
15
5 . In ` /test-docker.sh ` , add the ` PROXY_PORT ` to the case statement
16
16
17
- To run on the CI server, modify ` /.circleci/config.yml ` suitably.
Original file line number Diff line number Diff line change
1
+ # The Caddyfile is an easy way to configure your Caddy web server.
2
+ #
3
+ # Unless the file starts with a global options block, the first
4
+ # uncommented line is always the address of your site.
5
+ #
6
+ # To use your own domain name (with automatic HTTPS), first make
7
+ # sure your domain's A/AAAA DNS records are properly pointed to
8
+ # this machine's public IP, then replace ":80" below with your
9
+ # domain name.
10
+
11
+ {
12
+ order cache before rewrite
13
+ cache
14
+ }
15
+
16
+ :8006 {
17
+ cache {
18
+ default_cache_control no-store
19
+ }
20
+ reverse_proxy http://127.0.0.1:8000 {
21
+ transport http {
22
+ dial_timeout 10s
23
+ }
24
+ }
25
+ }
26
+
27
+ # Refer to the Caddy docs for more information:
28
+ # https://caddyserver.com/docs/caddyfile
Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ if [[ ! -z $1 ]] ; then
20
20
# varnish
21
21
sed -i s/127.0.0.1/$1 / /etc/varnish/default.vcl
22
22
23
+ # caddy
24
+ sed -i s/127.0.0.1/$1 / /etc/caddy/Caddyfile
25
+
23
26
serve.sh
24
27
fi
25
28
Original file line number Diff line number Diff line change @@ -15,3 +15,6 @@ source /etc/apache2/envvars
15
15
16
16
echo " * Starting Varnish"
17
17
/usr/sbin/varnishd -j unix -a 0.0.0.0:8005 -f /etc/varnish/default.vcl -p default_ttl=0 -p default_grace=0 -p default_keep=3600 -s malloc,64M
18
+
19
+ echo " * Starting Caddy"
20
+ HOME=/root /caddy run --config /etc/caddy/Caddyfile
Original file line number Diff line number Diff line change 5
5
PIDFILE=/tmp/http-cache-test-server.pid
6
6
7
7
8
- ALL_PROXIES=(squid nginx apache trafficserver varnish nuster)
8
+ ALL_PROXIES=(squid nginx apache trafficserver varnish caddy nuster)
9
9
DOCKER_PORTS=" "
10
- for PORT in {8001..8005 }; do
10
+ for PORT in {8001..8006 }; do
11
11
DOCKER_PORTS+=" -p ${PORT} :${PORT} "
12
12
done
13
13
@@ -71,6 +71,9 @@ function test_proxy {
71
71
varnish)
72
72
PROXY_PORT=8005
73
73
;;
74
+ caddy)
75
+ PROXY_PORT=8006
76
+ ;;
74
77
nuster)
75
78
PROXY_PORT=9001
76
79
;;
You can’t perform that action at this time.
0 commit comments