From de4f1ccfbed73346d7e73ca49a67fb6065272f0f Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Sun, 12 Feb 2023 20:56:37 -0600 Subject: [PATCH] Hide Authorization header for syncthing Add rest endpoint for syncthing --- syncthing.subdomain.conf.sample | 12 ++++++++++++ syncthing.subfolder.conf.sample | 13 +++++++++++++ 2 files changed, 25 insertions(+) diff --git a/syncthing.subdomain.conf.sample b/syncthing.subdomain.conf.sample index c03e7d1..64edc7b 100644 --- a/syncthing.subdomain.conf.sample +++ b/syncthing.subdomain.conf.sample @@ -42,5 +42,17 @@ server { set $upstream_proto http; proxy_pass $upstream_proto://$upstream_app:$upstream_port; + proxy_hide_header Authorization; + } + + location ~ (/syncthing)?/rest { + include /config/nginx/proxy.conf; + include /config/nginx/resolver.conf; + set $upstream_app syncthing; + set $upstream_port 8384; + set $upstream_proto http; + proxy_pass $upstream_proto://$upstream_app:$upstream_port; + + proxy_hide_header Authorization; } } diff --git a/syncthing.subfolder.conf.sample b/syncthing.subfolder.conf.sample index be5a72f..741eed3 100644 --- a/syncthing.subfolder.conf.sample +++ b/syncthing.subfolder.conf.sample @@ -28,4 +28,17 @@ location ^~ /syncthing/ { proxy_pass $upstream_proto://$upstream_app:$upstream_port; rewrite /syncthing(.*) $1 break; + proxy_hide_header Authorization; +} + +location ^~ /syncthing/rest { + include /config/nginx/proxy.conf; + include /config/nginx/resolver.conf; + set $upstream_app syncthing; + set $upstream_port 8384; + set $upstream_proto http; + proxy_pass $upstream_proto://$upstream_app:$upstream_port; + + rewrite /syncthing(.*) $1 break; + proxy_hide_header Authorization; }