location / { add_header Cache-Control no-cache; add_header Access-Control-Allow-Origin *; root /var/www/stream; index index.html; try_files $uri $uri/ =404; # Allow CORS preflight if ($request_method = OPTIONS) { add_header Access-Control-Allow-Origin *; add_header Access-Control-Max-Age 1728000; add_header Content-Length 0; return 204; } } location /dash { add_header Cache-Control no-cache; add_header Access-Control-Allow-Origin *; root /var/www/stream; types { application/dash+xml mpd; video/mp4 m4v mp4; } }