Nginx configuration file content explanation
----------------nginx Configure gzip compression Under normal circumstances, the size of compressed html, css, js, php, jhtml and other files can be reduced to 25% of the original size, that is to say, the original 100k html is only 25k after compression. This will undoubtedly save a lot of bandwidth and reduce the load on the server. It is relatively simple to configure gzip in nginx In general, just add the following lines of configuration to the http section of nginx.conf gzip on; gzip_min_length 1000; gzip_buffers 4 8k; gzip_types text/plain application/x-Javascript text/css text/html application/xml; restart nginx You can use the webpage gzip detection tool to detect whether gzip is enabled on the webpage http://gzip.zzbaike.com/ —————How to redirect nginx error page error_page 404 /404.html; This 404.html is guaranteed to be in the html directory under the nginx main directory. If you need to jump directly to another address after a 404 error occurs, you can directly set it as follows: error_page 404 http://www.***.net; In the same way, common errors such as 403 and 500 can be defined. Please note that the page size of the 404.html file must exceed 512k, otherwise it will be replaced by the default error page of ie…