S2stream: solution to serve files locally with nginx

Update:

This solution does not work as it should.

The video is not protected. I can access it directly by typing the URL, even without login.

Sorry by giving you some hope :frowning:


Hello.

I am running nginx and just figured out that I can’t serve files locally, but there is a workaround!

If your site is powered by the Nginx web server, you must use the Amazon S3/CloudFront integration to host your files. You cannot serve files locally.
https://s2member.com/kb-article/s2stream-shortcode-documentation/

I don’t know what happens on the background, but I noticed that the jwplayer looks for the file in /s2member-files/s2member-file-stream-no/s2member-file-inline/ and not in /s2member-files/ as I pointed on the shortcode.

To get it working, I uploaded the video on the folder /s2member-files/s2member-file-stream-no/s2member-file-inline/ and then created a blank file with the same name of the video on /s2member-files/.

So the /wp-content/plugins/ folder is looking like that:

s2member-files                                (directory)
|     video.mp4                               (blank file)
|     s2member-file-stream-no                 (directory)
|     |     s2member-file-inline              (directory)
|     |     |    video.mp4                    (real video)

I is likely to have a better solution using symlink or some nginx.conf – in a way to ā€œautomatizeā€ the workaround, but I don’t know how to do and this works for now.

I know: would be easier to just use S3, but right now it’s not on the budget.