500 (Internal Server Error) The server encountered an error and could not complete the request. In the case of high concurrent connections, Nginx is a good alternative to Apache server. Nginx can also be used as a layer 7 load balancing server. According to the test results, Nginx 0.6.31 + PHP 5.2.6 (FastCGI) can handle more than 30,000 concurrent connections, which is 10 times that of Apache under the same environment. But many people will encounter 500 errors when using Nginx. According to my experience, there are the following situations. 1. Is there insufficient disk space? Use df -k to check whether the hard disk space is full. Clearing up hard drive space can resolve 500 errors. If nginx has access log enabled, it is best to disable access log if it is not needed. The access log will take up a lot of hard disk space. 2. Is the nginx configuration file wrong? This does not refer to syntax errors. If there are syntax errors in the nginx configuration file, it will be prompted when it is started. When configuring rewrite, some rules may not be handled properly and a 500 error may occur. Please check your rewrite rules carefully. A 500 error may also occur if some variables in the configuration file are not set correctly, such as referencing a variable that has no value. 3. If none of the above problems exist, it may be that the number of simulated concurrency is too large, and you need to adjust the concurrency setting number of nginx.conf 4. Another problem is that the Linux index node (inode) is full and causes failure. df -i There could be many reasons, I just record the ones I encountered. 500, internal server error, may actually be an error caused at the code level. First, check the ngnix or Apache error log, and then check the error log. You can basically find the cause of the error based on the error log, or search the error log on Google or Baidu. Secondly, you can view the error log information of the framework, such as laravel.log. sudo find / -name '*.log' or cd /var/log/nginx/ && ls cat /var/log/nginx/newdns.com-error.log Summary: The error I encountered this time was because my MySQL table did not have the `updated_at`, `created_at` fields, and was not set in the Laravel framework model public $timestamps = false; , I wrote the wrong path when rewriting the exception handler Exception, which caused MySQL to throw an error. The framework exception handler could not handle it, so it ran to the server, causing the server to hang. I was devastated. This is the end of this article about Nginx service 500: Internal Server Error, one of the reasons. For more information about Nginx service 500 error, please search 123WORDPRESS.COM’s previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Data storage implementation method in WeChat applet
>>: Solve the MySQL login 1045 problem under centos
<br />In the previous article, I introduced ...
Installation Environment Description •System vers...
VUE uses vue-seamless-scroll to automatically scr...
1. Overview This article systematically explains ...
Table of contents Preface Enumerable properties I...
Example source code: https://codepen.io/shadeed/p...
Nginx does not support nested if statements, nor ...
1. First, we create a .json file for interactive ...
Introduction By enabling the slow query log, MySQ...
Table of contents Overview What are callbacks or ...
<br />Most of the time when we talk about na...
Table of contents 1. How to view the binary data ...
Introduction: MySQL database recovery by time poi...
Preface: To store multiple elements, arrays are t...
This article example shares the specific code of ...