Skip to content
Snippets Groups Projects
Commit f3d5bd80 authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

Allow streaming root url access (refs #18553).

parent 8b798ce2
No related branches found
No related tags found
No related merge requests found
...@@ -26,11 +26,21 @@ server { ...@@ -26,11 +26,21 @@ server {
access_log /var/log/nginx/access_msuser.log; access_log /var/log/nginx/access_msuser.log;
error_log /var/log/nginx/error_msuser.log; error_log /var/log/nginx/error_msuser.log;
location /static {
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
}
location /public { location /public {
expires 30d; expires 30d;
add_header Pragma public; add_header Pragma public;
add_header Cache-Control "public"; add_header Cache-Control "public";
} }
location /crossdomain {
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
}
location /resources { location /resources {
location ~ \.ts$ { location ~ \.ts$ {
} }
...@@ -47,40 +57,35 @@ server { ...@@ -47,40 +57,35 @@ server {
return 403; return 403;
} }
} }
location /static { location /streaming/ {
expires 30d; location ~ \.m3u8$ {
add_header Pragma public;
add_header Cache-Control "public";
}
location /crossdomain {
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
}
location ~ ^/streaming/.*\.m3u8.*$ {
rewrite ^/streaming/(.*)$ /live/$1 break; rewrite ^/streaming/(.*)$ /live/$1 break;
proxy_pass http://localhost:1935; proxy_pass http://localhost:1935;
add_header Access-Control-Allow-Origin "*";
add_header X-Cache $upstream_cache_status;
expires -1;
proxy_cache livecache; proxy_cache livecache;
proxy_cache_key $scheme$proxy_host$uri;
proxy_cache_lock on; proxy_cache_lock on;
expires -1;
proxy_cache_min_uses 1; proxy_cache_min_uses 1;
proxy_cache_valid 200 1s;
add_header X-Cache $upstream_cache_status;
add_header Access-Control-Allow-Origin "*";
proxy_cache_key $scheme$proxy_host$uri;
proxy_cache_use_stale updating; proxy_cache_use_stale updating;
} proxy_cache_valid 200 1s;
location ~ /streaming/.*\.(ts).*$ { }
location ~ \.ts$ {
rewrite ^/streaming/(.*)$ /live/$1 break; rewrite ^/streaming/(.*)$ /live/$1 break;
proxy_pass http://localhost:1935; proxy_pass http://localhost:1935;
add_header Access-Control-Allow-Origin "*";
add_header X-Cache $upstream_cache_status;
expires 2s;
proxy_cache livecache; proxy_cache livecache;
proxy_cache_key $scheme$proxy_host$uri;
proxy_cache_lock on; proxy_cache_lock on;
expires 2s;
proxy_cache_min_uses 1; proxy_cache_min_uses 1;
proxy_cache_valid 200 10s; proxy_cache_valid 200 10s;
add_header X-Cache $upstream_cache_status; }
add_header Access-Control-Allow-Origin "*"; # only urls to ts and m3u8 files are allowed, discard any requested path for other urls
proxy_cache_key $scheme$proxy_host$uri; rewrite ^/streaming/(.*)$ /live/ break;
proxy_pass http://localhost:1935/live/;
} }
location / { location / {
uwsgi_pass unix:///home/msuser/mstmp/uwsgi.sock; uwsgi_pass unix:///home/msuser/mstmp/uwsgi.sock;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment