PHP-FPM with EasyHAProxy FastCGI Plugin

Success! PHP is running via FastCGI protocol through HAProxy.

FastCGI Environment

PHP Version
Server Software
Document Root
Script Filename
Request URI
Request Method
Server Name
Server Port
HTTPS
PATH_INFO
Gateway Interface

Test Links

How This Works

This setup uses HAProxy with EasyHAProxy to proxy requests to PHP-FPM via the FastCGI protocol:

  1. HAProxy receives HTTP request on port 80
  2. The FastCGI plugin generates an fcgi-app configuration that defines CGI parameters (SCRIPT_FILENAME, DOCUMENT_ROOT, etc.)
  3. HAProxy uses this configuration to communicate with PHP-FPM via the FastCGI protocol
  4. HAProxy connects to PHP-FPM (via TCP port 9000 or Unix socket, depending on configuration)
  5. PHP-FPM processes the PHP script and returns the response
  6. HAProxy sends the response back to the client

Configuration

The FastCGI plugin is configured in docker-compose-php-fpm.yml: