Answer the question
In order to leave comments, you need to log in
Why only index.php works?
I launched nginx + php7.4-fpm on the vagrant, everything seems to be fine, I did the routing, everything works, but as soon as I had to open one php file, I immediately had problems, instead of executing php, nginx just throws it to me on the page, although index.php works perfect and php is executed.
Host php section config:
location ~ \.php$ {
#include snippets/fastcgi-php.conf;
# With php7.0-fpm:
fastcgi_read_timeout 300;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
Answer the question
In order to leave comments, you need to log in
you did not bring the entire config, most likely you have something like this:
location / {
try_files $uri /index.php?$args;
}
location / {
try_files $uri @rewrite;
}
location @rewrite {
rewrite ^/first/?$ first.php;
rewrite ^/second/?$ second.php;
rewrite ^ /index.php;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question