Answer the question
In order to leave comments, you need to log in
Nginx / PHP - how to restrict access to static files (pictures, media) from PHP?
Is it possible to configure nginx to only serve static if the user has permission to do so? Permissions are defined in the business logic inside PHP scripts.
I understand that this can easily be done in such a way that all static files are served through PHP, but in this case there will be a greater load on server resources.
Is there an alternative?
Answer the question
In order to leave comments, you need to log in
Most likely the X-Accel-Redirect header will help you: https://www.nginx.com/resources/wiki/start/topics/... .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question