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.
Created
October 14, 2022 18:58
-
-
Save halomakes/775f67a7f7c0d225d18064ceef512f6b to your computer and use it in GitHub Desktop.
The Lounge Uploads Proxy with Inline MOV files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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