From 0eb34a549e37c69e4f69fe128306871f83dc2e8b Mon Sep 17 00:00:00 2001 From: Michael Winter Date: Thu, 29 Jun 2023 00:06:52 +0200 Subject: [PATCH] nginx change header for pdfs should now be working --- nginx/vhost.d/unboundedpress.org | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nginx/vhost.d/unboundedpress.org b/nginx/vhost.d/unboundedpress.org index 1cb3242..20d7741 100644 --- a/nginx/vhost.d/unboundedpress.org +++ b/nginx/vhost.d/unboundedpress.org @@ -9,6 +9,15 @@ location ^~ /.well-known/acme-challenge/ { } ## End of configuration add by letsencrypt container +# This is to set the content type to prevent downloading until I actually implement a proper pdf viewer + +location ~ ^/api/(scores|pubs)(.*)/binary$ { + proxy_pass http://unboundedpress.org-357322ae39f93f572e23cd9edd3307e2ac5a321f; + # types { } default_type application/pdf; + proxy_hide_header Content-Type; + add_header Content-Type "application/pdf"; +} + # The following are all for collabora routing # static files