一行代码
error_page 502 http://localhost:xxxx;

当502时会跳转到http://localhost:xxxx
http://localhost:xxxx这个接口来重启php-fpm