第二步,編輯你需要添加404頁面的網站的conf文件,對應在 usr/local/nginx/conf/vhost/XXXX.com.conf,在server區域添加代碼; 復制代碼 代碼如下: error_page 404 = /404.html; 第三步,重啟 LNMP; 復制代碼 代碼如下: /root/lnmp restart 總結,我們可以通過 /usr/local/nginx/sbin/nginx -t 來測試返回狀態是否正確。 復制代碼 代碼如下: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok configuration file /usr/local/nginx/conf/nginx.conf test is successful 如果是上述返回狀態,就是正確的。
新聞熱點
疑難解答