1.6常见的502问题

配置错误

在nginx中:

location ~ \.php$ {

        include fastcgi_params;

        fastcgi_pass unix:/tmp/php-fcgi.sock;

        fastcgi_index index.php;

        fastcgi_param SCRIPT_FILENAME /data/www$fastcgi_script_name;

    }

fastcgi_pass后面指定路径配置错误,会出现502错误,fastcgi_pass后面可以跟socket也可以跟ip:port,默认监听地址为127.0.0.19000

二、资源耗尽

LNMP处理php时,nginx直接调用php-fpm服务,php-fpm资源耗尽出现502错误,调整php-fpm.conf中的pm.max_children数值,使其增加。4G内存服务器只跑php-fpm和nginx,不跑mysql服务,pm.max_children可以设置为150,8G内存可以设置为300。


你可能感兴趣的:(1.6常见的502问题)