Difference between revisions of "NGINX - Monitoring PHP-fpm"
From wiki.1001solutions.net
(Created page with "Category:Post-It = PHP Configuration = In '''/etc/php/7.X/fpm/pool.d/www.conf''' uncomment: <nowiki> pm.status_path = /status</nowiki> = NginX Configuration = In...") |
|||
Line 13: | Line 13: | ||
= NginX Configuration = | = NginX Configuration = | ||
− | In '''/etc/nginx/nginx.conf''' | + | In '''/etc/nginx/nginx.conf''' adapt: |
<nowiki> | <nowiki> | ||
server { | server { | ||
Line 32: | Line 32: | ||
<nowiki> | <nowiki> | ||
curl http://127.0.0.1/status</nowiki> | curl http://127.0.0.1/status</nowiki> | ||
− | |||
− | |||
= Sources = | = Sources = |
Latest revision as of 10:31, 1 May 2020
PHP Configuration
In /etc/php/7.X/fpm/pool.d/www.conf uncomment:
pm.status_path = /status
NginX Configuration
In /etc/nginx/nginx.conf adapt:
server { listen 127.0.0.1:80; server_name 127.0.0.1; location ~ ^/(status|ping)$ { allow 127.0.0.1; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_index index.php; include fastcgi_params; #fastcgi_pass 127.0.0.1:9000; fastcgi_pass unix:/var/run/php/php7.X-fpm.sock; } }
Restart the service and test with:
curl http://127.0.0.1/status
Sources
- https://nginx.org/en/docs/http/ngx_http_stub_status_module.html
- https://www.nginx.com/blog/monitoring-nginx/