Hi I'm running a laravel and nginx site which serves a variety of different content al of which is working very well except for the videos. They never seem to be served at all. Im pretty new to both nginx and laravel and not really sure what im missing, any help is greatly appreciated.
sites-enabled
root /home/mysite/public;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
server_name _;
charset utf-8;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log off;
error_log /var/log/nginx/myapp-error.log error;
sendfile off;
client_max_body_size 100m;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
}
location ~ /\.ht {
deny all;
}
}
Laravel response
public function video($videoName)
{
if (!File::exists('/content/video/' . $videoName)) {
throw new \Exception("Video does not exist.", 404);
}
$fileContents = File::get('/content/video/' . $videoName);
$response = Response::make($fileContents, 200);
$response->header('Content-Type', "video/mp4");
return $response;
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire