The nginx documentation has plenty of information on how to serve static files directly:

https://www.nginx.com/resources/admin-guide/serving-static-content/

On 10 March 2016 at 10:11, Richard Reina <gatorreina@gmail.com> wrote:
Christian,

I have determined that the problem is due to http byte range request which the server must support when downloading videos to iOS. The soultion is I am told to have NGINX serve videos files directly which is something I have not been able to figure out in nginx.conf. If anyone knows how I can modify my config (below) to achieve this I would be very grateful.

server {
    listen 80;
    server_name almslete.com;
    rewrite ^/(.*) https://mydomain.com/$1 permanent;
	    }

server {
    listen 443 ssl;
    server_name almslete.com;
    ssl_certificate /home/starman/mydomain.com.certificicate.crt;
    ssl_certificate_key /home/infinityanbeyond/mygroovykey.com.key;
    client_max_body_size 20M;

    location / {

	# Serve static files directly:
         if (-f $request_filename) {
               expires 30d;
               break;
            }

  	proxy_set_header X-Forwarded-Proto $scheme;
  	proxy_set_header Host $http_host;
	proxy_set_header X-Forwarded-Host $http_host;
	proxy_set_header X-Real-IP $remote_addr;
	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://localhost:5000;
	    }
    }


2016-03-10 11:53 GMT-06:00 Christian Huldt <christian@solvare.se>:
Den 2016-03-10 kl. 15:54, skrev Richard Reina:
> Does anyone know if there is anything related to an
> NGINX->Starman->Dancer stack that would prevent html5 videos from
> playing on safari iOS (on an Iphone or Ipad)? I realize that such a
> idea seems unlikley, but this embeded video
> http://www.w3schools.com/html/html5_video.asp plays on my ipnone.
> However, when I download the video and put in my Dancer2 app and use
> their markup (below) the video plays perfectly on a desktop but will
> not play on my Iphone. Being that I am downloading their video it
> cannot be an encoding issue.
>
> <h3>HTML Video Example.  Courtesy of <a
> href="http://www.bigbuckbunny.org/" target="_blank">Big Buck
> Bunny</a>.</h3>
> <div class="w3-padding w3-white notranslate">
>   <div style="text-align:center">
>   <video id="video1" style="width:600px;max-width:100%;" controls>
>     <source src="user_vids/uploads/user_vidL_5_111222333.mp4"
> type="video/mp4">
>     <source src="user_vids/uploads/user_vidL_5_111222333.ogv"
> type="video/ogg">
>     Your browser does not support HTML5 video.
>   </video>
> </div>
> </div>

Is user_vids/uploads/user_vidL_5_111222333.mp4 assigned the proper MIME
(something like video/mp4...) ?


_______________________________________________
dancer-users mailing list
dancer-users@dancer.pm
http://lists.preshweb.co.uk/mailman/listinfo/dancer-users



_______________________________________________
dancer-users mailing list
dancer-users@dancer.pm
http://lists.preshweb.co.uk/mailman/listinfo/dancer-users