Focus on cloud service provider activities
Notes on website operation and maintenance

Resolve the problem that the Nginx environment custom 404 page does not take effect

For example, we use the WordPress program, and some other programs will default to the 404 jump page prompt, but sometimes we need to customize the 404 page how to operate? In theory, it is very simple. If we use the Nginx environment, we can directly remove the default # error_page 404 from the. conf file configured for the current site, and then add the page. Restart NGINX directly to take effect.

However, this time, according to this operation, it did not take effect. It seems that something is wrong. Then a student told me that the NGINX file is missing.

fastcgi_intercept_errors on;

 Resolve the problem that the Nginx environment custom 404 page does not take effect

After adding, we can restart Nginx. Of course, we need to add the following in the current site configuration file:

error_page 404 /404.html;

Specify the page.

Vote for you
Domain name host preferential information push QQ group: six hundred and twenty-seven million seven hundred and seventy-five thousand four hundred and seventy-seven Get preferential promotion from merchants.
Like( zero )
Do not reprint without permission: Lao Zuo's Notes » Resolve the problem that the Nginx environment custom 404 page does not take effect