I’m encountering an issue while working on a Symfony project with an Nginx server. I’m unable to access a PHP file located outside of the project directory. Specifically, I’m trying to access a file named info.php
, but I consistently receive a 404 Not Found error
.
`server {
listen 443 ssl;
server_name mydomain;
root mypublicdir/public;
location / {
try_files $uri /index.php$is_args$args;
}
location = /info.php {
include fastcgi_params;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
fastcgi_split_path_info ^(.+.php)(/.*)$;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}`
I’ve attempted to access the file using the domain (mydomain/info.php), but I continue to encounter the 404 Not Found error.
New contributor
ertuğrul sinan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.