After setting up lnmp, sometimes you don’t need to access index.php directly. You need to configure other default access files such as index.html. At this time, you need to configure nginx to access the file you want to set.
Go directly to the code. The following is a simple nginx to php-fpm site configured by me. The site defaults to accessing the directory /ecmoban/www/index.html
server { listen 80; location / { root /ecmoban/www; index index.html index.php index.htm; } error_page 404 /404.html; location = /404.html { root /usr/share/nginx/html; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } location ~ \.php$ { root /ecmoban/www; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.html; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
The above is what the editor gives you The introduced PHP website modifies the nginx configuration of the default access file. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time.