server {
index index.html index.php;
location / {
try_files $uri $uri/ $uri.html $uri.php?$query_string;
}
location ~ \.php$ {
try_files $uri =404;
# add fastcgi_pass line here, depending if you use socket or port
}
}
The core is the use of the try_files command, you can refer to the NGINX documentation
The core is the use of the
try_files
command, you can refer to the NGINX documentation