diff options
Diffstat (limited to 'proxy')
| -rw-r--r-- | proxy/Dockerfile | 16 | ||||
| -rw-r--r-- | proxy/fly.toml | 22 | ||||
| -rw-r--r-- | proxy/nginx.conf | 14 | ||||
| -rwxr-xr-x | proxy/start.sh | 6 |
4 files changed, 58 insertions, 0 deletions
diff --git a/proxy/Dockerfile b/proxy/Dockerfile new file mode 100644 index 0000000..012092d --- /dev/null +++ b/proxy/Dockerfile @@ -0,0 +1,16 @@ +FROM nginx:1.27.0-alpine + +RUN apk update && apk add ca-certificates iptables ip6tables && rm -rf /var/cache/apk/* + +COPY --from=docker.io/tailscale/tailscale:stable /usr/local/bin/tailscaled /app/tailscaled +COPY --from=docker.io/tailscale/tailscale:stable /usr/local/bin/tailscale /app/tailscale +RUN mkdir -p /var/run/tailscale /var/cache/tailscale /var/lib/tailscale + +WORKDIR /app/ + +COPY nginx.conf /etc/nginx/conf.d/nginx.conf +COPY /start.sh /app/start.sh + +RUN chmod +x /app/start.sh + +CMD ["/app/start.sh"] diff --git a/proxy/fly.toml b/proxy/fly.toml new file mode 100644 index 0000000..97bf7b5 --- /dev/null +++ b/proxy/fly.toml @@ -0,0 +1,22 @@ +# fly.toml app configuration file generated for home-divine-bush-1861 on 2024-08-11T17:34:11+01:00 +# +# See https://fly.io/docs/reference/configuration/ for information about how to use this file. +# + +app = 'home-divine-bush-1861' +primary_region = 'lhr' + +[build] + +[http_service] + internal_port = 8080 + force_https = true + auto_stop_machines = 'stop' + auto_start_machines = true + min_machines_running = 0 + processes = ['app'] + +[[vm]] + memory = '1gb' + cpu_kind = 'shared' + cpus = 1 diff --git a/proxy/nginx.conf b/proxy/nginx.conf new file mode 100644 index 0000000..4095372 --- /dev/null +++ b/proxy/nginx.conf @@ -0,0 +1,14 @@ +server { + listen 8080; + listen [::]:8080; + + server_name a73x.sh; + + + location / { + proxy_ssl_session_reuse off; + proxy_ssl_server_name on; + proxy_pass https://home.folk-amberjack.ts.net/; + proxy_set_header X-Forwarded-Host $http_host; + } +} diff --git a/proxy/start.sh b/proxy/start.sh new file mode 100755 index 0000000..c2c73d6 --- /dev/null +++ b/proxy/start.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +/app/tailscaled --state=/var/lib/tailscale/tailscaled.state --socket=/var/run/tailscale/tailscaled.sock & +/app/tailscale up --authkey=${TAILSCALE_AUTHKEY} --hostname=fly-app + +nginx -g "daemon off;" |
