I have nginx web-server and PHP business logic. I want to allow access static files (images, media) only for certain users.
The authentication rules are defined in PHP.
I understand that it is easily achievable via serving static files through PHP. But it will cost in low performance.
Is there an alternative approach?