Answer the question
In order to leave comments, you need to log in
nginx + php-fpm setup: folder exists and index.php exists
the site works on apache, the task is to transfer it to a bunch of nginx + php-fpm.
There is a config:
location / {
index index.php
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?$args last;
break;
}
}
Answer the question
In order to leave comments, you need to log in
everything has long been done through try files
bad example
location ~ \.php$ {
<------> try_files $uri =404;
fastcgi_pass unix:/opt/pifpm/fpmsockets/fashions.sock;
fastcgi_index index.php;
include fastcgi_params;
you need to add one more match condition for try_files - $uri/
index index.php index.html index.htm;
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
rewrite ^ /index.php?$args;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question