1. Hard disk space is full
Use df-k to check whether the disk space is full. Clear the hard disk space to solve the 500 error. If access log is enabled for nginx, you are advised to disable access log when you do not need it. Access log occupies a large amount of hard disk space.
2. nginx configuration file error
This does not mean a syntax error. If the configuration file of nginx has a syntax error, a prompt will be displayed at startup. When configuring rewrite, some rules may encounter a 500 error if they are improperly handled. Check your rewrite rules carefully. If some variables in the configuration file are improperly set, a 500 error occurs, for example, a variable without a value is referenced.
3. If none of the above problems exist, it may be that the number of concurrent threads in the simulation is too large. You need to adjust the number of concurrent settings in nginx. conf.
Solution:
1 Open the/etc/security/limits. conf file and add two
The code is as follows: |
Copy code |
* Soft nofile 65535 * Hard nofile 65535 |
2 Open/etc/nginx. conf
Add a row under worker_processes
The code is as follows: |
Copy code |
Worker_rlimit_nofile 65535; |
3. Restart nginx and reload the settings.
The code is as follows: |
Copy code |
Kill-9 'PS-ef | grep php | grep-v grep | awk' {print $2 }'' /Usr/bin/spawn-fcgi-a 127.0.0.1-p 9000-C 100-u www-data-f/usr/bin/php-cgi Killall-HUP nginx |
After restart, check the nginx error log again. No error 500 is reported.
4. There may be a database problem. I did not find any problems in the nginx log php log. I finally found that the database could not be accessed. The problem was solved after the modification.