nginx服務器頻繁報「500 Internal Server Error」錯誤,是因爲服務器上文炳數設置過小,設置方法以下:
1>. /etc/security/limits.conf文件,最後加上兩句
* soft nofile 65535
* hard nofile 65535
2>. /etc/sysctl.conf,增長:
fs.file-max=65536
3>. nginx配置文件nginx.conf,增長:
在worker_processes的下面增長一行
worker_rlimit_nofile 65535;
操做:
1>. sysctl -p
2>. 重啓nginxnginx