-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to separate nginx conf file and update liquidsoap to master
- Loading branch information
Showing
3 changed files
with
60 additions
and
59 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
server { | ||
listen 80; | ||
|
||
server_name _; | ||
|
||
location /healthz { | ||
access_log off; | ||
return 200; | ||
} | ||
|
||
location /api { | ||
add_header Allow "GET" always; | ||
if ( $request_method !~ ^(GET)$ ) { | ||
return 405; | ||
} | ||
rewrite /api/(.*) /$1 break; | ||
proxy_pass http://liquidsoap:8081; | ||
proxy_redirect off; | ||
proxy_set_header Host $host; | ||
} | ||
|
||
types { | ||
application/vnd.apple.mpegurl m3u8; | ||
video/mp2t ts; | ||
} | ||
|
||
location ~ \.(ts|m3u8)$ { | ||
add_header Allow "GET, HEAD" always; | ||
if ( $request_method !~ ^(GET|HEAD)$ ) { | ||
return 405; | ||
} | ||
|
||
root /hls; | ||
|
||
add_header 'Access-Control-Allow-Origin' '*'; | ||
add_header 'Access-Control-Allow-Methods' 'GET'; | ||
add_header 'Access-Control-Allow-Headers' '*'; | ||
|
||
location ~ \.(ts)$ { | ||
add_header 'Cache-Control' 'public, max-age=31536000'; | ||
} | ||
|
||
location ~ (lofi|midfi|hifi)\.(m3u8)$ { | ||
add_header 'Cache-Control' 'max-age=1'; | ||
} | ||
|
||
location ~ \.(m3u8)$ { | ||
add_header 'Cache-Control' 'max-age=600'; | ||
} | ||
} | ||
|
||
location / { | ||
return 404; | ||
} | ||
} |