Quantcast
Channel: Nginx Forum - Other discussion
Viewing all articles
Browse latest Browse all 972

Nginx cannot read the index file

$
0
0
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.

Viewing all articles
Browse latest Browse all 972

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>