Skip to content

Commit

Permalink
feat: add varnish default vcl
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo Gomes committed Apr 19, 2023
1 parent 17c17e7 commit faff6c2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions proxy_cached/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ RUN apt-get -y update && apt-get -y upgrade &&\

COPY docker-entrypoint.sh /
COPY nginx.default.template /
COPY varnish.default.template /

RUN set -e; \
export DEBIAN_FRONTEND=noninteractive; \
Expand Down
1 change: 1 addition & 0 deletions proxy_cached/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

set -e

cp /varnish.default.template /etc/varnish/default.vcl
envsubst '$SERVER_NAME$PROXY_PROTO$PROXY_HOST' < /nginx.default.template > /etc/nginx/default.conf;

if [ "$#" -eq 0 ] ; then
Expand Down
14 changes: 14 additions & 0 deletions proxy_cached/varnish.default.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
vcl 4.1;

backend default {
.host = "127.0.0.1";
.port = "8080";
}

sub vcl_recv {
if (req.method != "GET" && req.method != "HEAD") {
return (pass);
}

return (hash);
}

0 comments on commit faff6c2

Please sign in to comment.