From a2017a0e502f1508d3cef30a25cffa07896b0ca7 Mon Sep 17 00:00:00 2001 From: Jason Raimondi Date: Wed, 13 Oct 2021 22:59:23 -0700 Subject: [PATCH 1/2] docs: adds example of reverse proxy with Caddy --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 32b4b33..3141f72 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,20 @@ location /metube/ { If you're using the [linuxserver/swag](https://docs.linuxserver.io/general/swag) image for your reverse proxying needs (which I can heartily recommend), it already includes ready snippets for proxying MeTube both in [subfolder](https://github.com/linuxserver/reverse-proxy-confs/blob/master/metube.subfolder.conf.sample) and [subdomain](https://github.com/linuxserver/reverse-proxy-confs/blob/master/metube.subdomain.conf.sample) modes under the `nginx/proxy-confs` directory in the configuration volume. + +### Reverse proxy using Caddy + +The following example Caddyfile gets a reverse proxy going behind [caddy](https://caddyserver.com) + +```caddyfile +example.com { + route /metube/* { + uri strip_prefix metube + reverse_proxy metube:8081 + } +} +``` + ## Build and run locally Make sure you have node.js and Python 3.8 installed. From b8cd48e8d71b11fcf3ac7e8d2fc9686b6a488482 Mon Sep 17 00:00:00 2001 From: Alex Shnitman Date: Thu, 14 Oct 2021 19:13:03 +0300 Subject: [PATCH 2/2] Rewording of the reverse proxy section of the README --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3141f72..00efaa6 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,13 @@ javascript:(function(){xhr=new XMLHttpRequest();xhr.open("POST","https://metube. ## Running behind a reverse proxy -Use the following nginx configuration to run MeTube behind a reverse proxy. The extra `proxy_set_header` directives are there to make WebSocket work. Don't forget to set the URL_PREFIX environment variable to the correct value as well. +It's advisable to run MeTube behind a reverse proxy, if authentication and/or HTTPS support are required. + +When running behind a reverse proxy which remaps the URL (i.e. serves MeTube under a subdirectory and not under root), don't forget to set the URL_PREFIX environment variable to the correct value. + +If you're using the [linuxserver/swag](https://docs.linuxserver.io/general/swag) image for your reverse proxying needs (which I can heartily recommend), it already includes ready snippets for proxying MeTube both in [subfolder](https://github.com/linuxserver/reverse-proxy-confs/blob/master/metube.subfolder.conf.sample) and [subdomain](https://github.com/linuxserver/reverse-proxy-confs/blob/master/metube.subdomain.conf.sample) modes under the `nginx/proxy-confs` directory in the configuration volume. It also includes Authelia which can be used for authentication. + +### NGINX ``` location /metube/ { @@ -89,10 +95,9 @@ location /metube/ { } ``` -If you're using the [linuxserver/swag](https://docs.linuxserver.io/general/swag) image for your reverse proxying needs (which I can heartily recommend), it already includes ready snippets for proxying MeTube both in [subfolder](https://github.com/linuxserver/reverse-proxy-confs/blob/master/metube.subfolder.conf.sample) and [subdomain](https://github.com/linuxserver/reverse-proxy-confs/blob/master/metube.subdomain.conf.sample) modes under the `nginx/proxy-confs` directory in the configuration volume. +Note: the extra `proxy_set_header` directives are there to make WebSocket work. - -### Reverse proxy using Caddy +### Caddy The following example Caddyfile gets a reverse proxy going behind [caddy](https://caddyserver.com)