Skip to content

Instantly share code, notes, and snippets.

@halomakes
Created October 14, 2022 18:58
Show Gist options
  • Save halomakes/775f67a7f7c0d225d18064ceef512f6b to your computer and use it in GitHub Desktop.
Save halomakes/775f67a7f7c0d225d18064ceef512f6b to your computer and use it in GitHub Desktop.
The Lounge Uploads Proxy with Inline MOV files

Proxies lounge uploads directory while adding headers to .MOV files (coming from Apple devices) to make them open in browser instead of downloading as an attachment.

server {
listen 80;
listen [::]:80;
server_name your.domain.name;
location / {
proxy_pass http://thelounge:9000/uploads/;
set $disposition $sent_http_content_disposition;
if ($uri ~ \.(mov|MOV)$) {
add_header Content-Type "video/mp4";
set $disposition "inline";
}
proxy_hide_header Content-Disposition;
add_header Content-Disposition $disposition;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment