Nginx directly input url to access pure html page, report error 404 Not Found, or main page (index) refresh error

it seems that apache will do the same.

clipboard.png

nginxserver
clipboard.png

linux


clipboard.png

personal website, there is no problem with index page refresh, but entering other page refresh will be gg.
http://leisuremoment.com/

Mar.04,2021

first check whether index.html exists in the web root directory, and then check the conf.d of nginx

-sharp 
root    /var/www/html;
location / {
    -sharp 
    index  index.html index.htm;
}

try_files is not written in the configuration, is it?

< hr >

Update

look at the configuration and talk about some problems found:

  1. rewrite ^ / (. *) http://www.leisuremoment.com/$1 permanent; and try_files do not use together. The latter is to solve (optimize) the former, so that we can use it together.
  2. with regard to try_files / var/www/html/index.html; , the root directory has been located with root before, but what comes out is actually based on the root directory, so it would be wrong to enter more sets of complete paths.
  3. try_files Let's write try_files $uri $uri/ / index.html; first
  4. .
  5. this paragraph:

      

    you post your nginx configuration information, and then release the url you visit, and you can figure out what the problem is

    .
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4ff59-43d9e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4ff59-43d9e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?