Skip to content

Commit

Permalink
Merge pull request #2 from mindbox-cloud/feature/l4
Browse files Browse the repository at this point in the history
Add layer4 module
  • Loading branch information
WGOS authored Aug 23, 2024
2 parents 0e1e3c8 + 849c6d8 commit c7dcaeb
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,7 @@ jobs:
context: .
file: ./Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}
platforms: |
linux/amd64
linux/arm64
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
ARG CADDY_VERSION=2.7
ARG CADDY_VERSION=2.8
FROM caddy:${CADDY_VERSION}-builder AS builder

RUN xcaddy build \
--with github.com/lucaslorentz/caddy-docker-proxy/v2 \
--with github.com/yroc92/postgres-storage \
--with github.com/ss098/certmagic-s3
--with github.com/ss098/certmagic-s3 \
--with github.com/mholt/caddy-l4

FROM caddy:${CADDY_VERSION}-alpine

COPY --from=builder /usr/bin/caddy /usr/bin/caddy
ADD ./sniproxy.Caddyfile /etc/caddy

CMD ["caddy", "docker-proxy"]
21 changes: 21 additions & 0 deletions sniproxy.Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
layer4 {
udp/:443 {
route {
proxy {l4.tls.server_name}:443
}
}

tcp/:443 tcp/:80 {
@insecure http
route @insecure {
proxy {l4.http.host}:80
}

@secure tls
route @secure {
proxy {l4.tls.server_name}:443
}
}
}
}

0 comments on commit c7dcaeb

Please sign in to comment.