diff --git a/modules/media-proxy.nix b/modules/media-proxy.nix index b9b3ea6..a2897e3 100644 --- a/modules/media-proxy.nix +++ b/modules/media-proxy.nix @@ -20,6 +20,12 @@ in systemd.services.nginx.after = [ "network-online.target" ]; services.nginx = { enable = true; + commonHttpConfig = '' + map $http_referer $media_proxy_referer { + ~^http://localhost:8888/ ""; + default $http_referer; + } + ''; virtualHosts.media-proxy = { serverName = "localhost"; listen = [ @@ -40,6 +46,8 @@ in proxy_buffering off; include ${secret}; charset utf-8; + proxy_set_header Referer $media_proxy_referer; + proxy_set_header Origin $media_proxy_referer; ''; }; })