It's hard to read your explanations.
sev 1. Files Gallery index.php and _files are in /srv/www
I had to read the above a couple of times, but it then means you have:
/srv/www/index.php
/srv/www/_files
/srv/www/_files/css/custom.css
When index.php
is loaded into browser, the custom.css
must be accessible from browser by relative url _files/css/custom.css
. If it's not, then it seems strange that you need to block this access path by Nginx.
sev storage_path is either the default files or absolute path /srv/www/files
What do you mean "either" 🤔 What's the difference between the two above? You just said index.php and _files are in /srv/www
so that would mean storage_page
is in /srv/www/_files
. What does "default _files" mean here anyway? Default in this case would be /srv/www/_files
. I can't extract any "either" in the above.
sev To simply reiterate, when a reverse proxy is involved, it is incorrect to assume that DIR == dirname($_SERVER[REQUEST_URI])
There is nothing in the code like that. We are just assuming that your servers document root does not change per request, because if it does, PHP doesn't know what the url's would be anyway ... It's definitely not "wrong" to assume this, because I would say this works fine for everyone who uses Files Gallery for many years, and it's not like there are any other options. It seems pretty logical for an app to assume urls based on the physical structure of the application, especially when there are no other ways.
sev and that's what urlpath() does right now.
It definitely does not check __DIR__ == dirname($_SERVER[REQUEST_URI])
... Not even sure what you are trying to say here. All PHP requests go to index.php
. All file requests go directly to the file from javascript. I would never need $_SERVER[REQUEST_URI] anyway, because we already know it goes to index.php
. It's not like we can intercept requests to files from PHP.
sev > We don't load cache directly by url, unless you use a special setting like image_resize_cache_direct
Didn't know that, is that a new feature? In any case, I must have missed it.
I'm really not sure what you mean. There is nothing loaded directly into browser from inside the _files
dir, unless you have specific features like custom.css
or image_resize_cache_direct
enabled. Never was. We need to load data through PHP, for several reasons, including validation and checking the cache files exist.