Welcome! Log In Create A New Profile

Advanced

Nginx cannot read the index file

Posted by hack3rcon 
Nginx cannot read the index file
March 17, 2024 02:34AM
Hello,
Nginx configuration is as follows:

server {
listen 80;
server_name default_server;
error_log /var/log/nginx/error.system-default.log;
access_log /var/log/nginx/access.system-default.log;
charset utf-8;

root /usr/share/nginx/html/;

location ~ \.php$ {
fastcgi_pass php-fpm:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
add_header script-filename $document_root$fastcgi_script_name always;
include fastcgi_params;
}

location / {
try_files $uri =404;
index index.php index.html;
}
}

When I enter the IP address of the web server in the browser, I get a "404 Not Found" message and I must add the file name at the end of the IP address to display the index file. Which line is wrong?

Thank you.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 189
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready