add reverse proxy to docker-compose
Marco Andronaco andronacomarco@gmail.com
Sat, 26 Aug 2023 11:53:57 +0200
4 files changed,
52 insertions(+),
0 deletions(-)
M
docker-compose.yaml
→
docker-compose.yaml
@@ -6,3 +6,18 @@ container_name: fixyoutube
restart: unless-stopped ports: - 127.0.0.1:1111:80 + + swag: + image: ghcr.io/linuxserver/swag + container_name: swag + cap_add: + - NET_ADMIN + env_file: + - docker/swag.env + volumes: + - /etc/config/swag:/config + - ./docker/fixyoutube.subdomain.conf:/config/nginx/proxy-confs/fixyoutube.subdomain.conf:ro + ports: + - 443:443 + - 80:80 + restart: unless-stopped
A
docker/fixyoutube.subdomain.conf
@@ -0,0 +1,22 @@
+# make sure that your app container is named fixyoutube +# make sure that your dns has a cname set for fixyoutube + +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + + server_name y.*; # change your subdomain here + + include /config/nginx/ssl.conf; + + client_max_body_size 0; + + location / { + include /config/nginx/proxy.conf; + include /config/nginx/resolver.conf; + set $upstream_app fixyoutube; + set $upstream_port 80; + set $upstream_proto http; + proxy_pass $upstream_proto://$upstream_app:$upstream_port; + } +}
A
docker/swag.env.example
@@ -0,0 +1,14 @@
+PUID=1000 +PGID=1000 +#valid TZs at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones +TZ=Etc/UTC +URL=domain.duckdns.org +SUBDOMAINS=wildcard +VALIDATION=duckdns +CERTPROVIDER= #optional +DNSPLUGIN= #optional +DUCKDNSTOKEN=abc123ab-c123-abc1-23ab-c123abc123ab +EMAIL=your@email.com +ONLY_SUBDOMAINS=false +EXTRA_DOMAINS=y +STAGING=false