How can I protect files on my NGiNX server?
- by Jean-Nicolas Boulay Desjardins
I am trying to protect files on my server (multiple types), with NGiNX and PHP.
Basically I want people to have to sign in to the website if they want to access those static files like images. DropBox does it very well. Where by they force you to sign in to access any static files you put on there server.
I though about using NGiNX Perl Module. And I would write a perl script that would check the session to see if the user was sign in to give them access to a static file.
I would prefer using PHP because all my code is running under PHP and I am not sure how to check a session created by PHP with PERL.
So basically my question is: How can I protect static files of any types that would need the user to have sign in and have a valid session created with a PHP script?