I looked at the nginx documentation and it still confuses me utterly
How does try_files work? Here is what the document says
syntax: try_files path1 [path2] uri
context: server, location
Checks for the existence of files in order, and returns the first file that is found. A trailing slash indicates a directory - $uri /. In the event that no file is found, an internal redirect to the last parameter is invoked. The last parameter is the fallback URI and must exist, or else an internal error will be raised. Unlike rewrite, $args are not automatically preserved if the fallback is not a named location. If you need args preserved, you must do so explicitly:
I dont understand how it checks the paths and what if i dont want a internal error and have it resume the rest of the path in effort to find another file?
If i have a cache file at
/path/app/cache/url/index.html and if it fails try
/path/app/index.php how do i write that? if i wrote
try_files /path/app/cache/ $uri include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/php-fastcgi/php-fastcgi.socket; fastcgi_param SCRIPT_FILENAME $document_root/index.php;
index index.php index.html index.htm; when i visit
/urlname will it try checking
/path/app/cache/urlname (index.php then)
/path/app/cache/urlname/index.html? if we ignore everything after try_files is it possibly for try_files to check this cache folder? i been trying and failed.