![nginx 404 not found nginx 404 not found](https://forum.aapanel.com/assets/files/2020-01-24/1579895974-104191-image.png)
$ sudo service nginx reload #debian/ubuntu If there are no errors, run the following command to restart NGINX server. NGINX Configuration 404 error page TurnWhat is 404 page If a problem happens to the site, or if the user tries to access a page that does not exist, the server. Run the following command to check syntax of your updated config file. htaccess file.This issue was discovered in NginX, an open source alternative to Google’s Apache.It allows you to configure a file that specifies the path of your website.
#Nginx 404 not found how to
Similarly, you can also catch 500 server error response, error_page 500 /error.html īonus Read : How To Implement NGINX Reverse Proxy A lot of people are getting 404 Not Filed errors when they try to access a website that isn’t listed on a domain’s.
#Nginx 404 not found code
If you want to deliver a different response code (e.g 200), then you can modify the above directive as shown below error_page 404 =200 /error.html In the above case, NGINX will redirect user to different URL, but with 404 response code. If you want to redirect 404 to homepage, add the following line error_page 404 / To redirect 404 error code to specific URL (e.g /error.html), add the following line to your NGINX configuration file. NGINX provides a built-in directive called error_page that allows you to catch different error responses and process them further. If you have configured virtual hosts for your website (e.g such as /etc/nginx/sites-enabled/nf then open it with the following command $ sudo vi /etc/nginx/sites-enabled/nf If you are using NGINX’s main configuration file nf, without virtual hosts, then run the following command $ sudo vi /etc/nginx/nf using dashboards & charts, to ensure everything is working well. Here are the steps to redirect 404 to Homepage in NGINX. After you redirect 404 to homepage in NGINX, you may want to use a charting tool to monitor the key metrics about your website/application such as signups, traffic, sales, revenue, etc. react. Here’s how to redirect 404 to homepage in NGINX. NGINX allows you to easily redirect 404 pages to a specific URL. When a requested URL is not found, it is advisable to redirect 404 error to another URL with next steps.