Linux · 2015-02-13

nginx查看php-fpm状态信息

#查看php-fpm状态的信息,修改php-fpm.conf
pm.status_path = /php-status

#修改nginx.conf
server {
    listen       $IP:$Port;
    server_name  _;

location ~ ^/php-status$ {
                stub_status on;
                access_log off;
				#allow all;
                allow $IP;
                deny all;
                include fastcgi_params;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
        }
}

#查看方式 http://$IP/php-status
#full list: http://$IP/php-status?full

#输出方式支持html、json、xml
#http://$IP/php-status?html #默认
##http://$IP/php-status?full&html

#http://$IP/php-status?json #json
##http://$IP/php-status?full&json

#http://$IP/php-status?xml #xml
##http://$IP/php-status?full&xml


#查看nginx状态
server {
    listen       $IP:$Port;
    server_name  _;
        location = /nginx-status {
                stub_status on;
                access_log off;
                allow $IP;
                deny all;
        }
}
#查看方式 http://$IP/nginx-status