Web Application Servers Infrastructure and Configuration (to Display and Stream Media with Laravel & Nginx)
Hi, I have questions about the infrastructure, and configuration of servers in a particular web application (to display and stream media). I am new to this field and my question may be simple. I would be grateful if you could guide me.
The web application I am considering is an interactive website where users upload their media such as images, videos and audio.
I have two servers, One of them has the web application (based on Laravel and MySQL) and User-uploaded files are stored on another server (by FTP).
Server 1: Web Application
Server 2: FTP server for storing media
Server 3: Database Server
Now my questions include several sections:
How to display files stored in FTP Server to users and how to link (URL of Media) to them within the laravel project.
I know that we can stream videos and audio by making some configurations in Nginx (Based on this Link). Now in my scenario that the files are stored on another server, how should this be done (Especially with video.js)? Should all HTTP requests be sent to the web application server and a decision made based on the path? For example, redirecting requests.
In which server should Streaming or HLS settings be made? Should Nginx be installed on both servers? Do I need a Reverse Proxy to do this?
In general, is the infrastructure and scenario provided a suitable solution? Or is there a better infrastructure?
In most of the references I saw, they have not considered the situation in which there are different servers. Is there a reference for such a situation that I should read?
For such a setup I'd most likely go with mounted shares
I would have a load balancer that has at least two nginx behind it and then I would have two or more mirrored nas's hosting the media files. The discs would be mounted to the nginx machines. I would go with NFS instead of FTP.
This is of course if you host everything yourself other wise I would most likely go with a AWS load balancer and two nginx instances. There are serveral media hosting companies that can host the media or you can use a shared S3 bucket from AWS.