mod_fastcgi — http(8gx) processing plugin for proxying requests to FastCGI servers


mod_fastcgi can forward HTTP requests to one or more FastCGI servers when certain URIs are requested. Take special note of the file suffix column documented below; in particular, to override an entire directory, you may also need to edit the table for mod_cache(4gx).

mod_fastcgi plugin is built into http(8gx) and not a separate .so file.

Configuration directives

This (built-in) plugin shares http.cfg. See http(8gx).

URI map

The filemap that specifies which URIs to handle is fastcgi.txt, which is searched for in config_file_path. The usual location is /etc/gromox/fastcgi.txt.

Each line in this file consists of 7 columns separated by whitespace:

  • Domain or asterisk-based wildcard ("*", "*") to match the HTTP Host: request header with.

  • URI path (prefix) to match

  • Mapped path that will be passed to the FastCGI executor. Note that the FastCGI process may additionally have a document root setting that could map the path one more time.

  • File suffix (without dot) to match on, e.g. php.

  • A file to use as the default file for a directory (similar to Apache httpd's DirectoryIndex).

  • A set of headers, separated by the pipe symbol |, which should be forwarded to the CGI handler. In absence of any desired extra headers, a single pipe can be used to fill the column.

  • An AF_LOCAL socket path to make the FastCGI request to.

If the file has no lines, no documents will be served this way. If the file is absent however, a set of default entries will be used.

Default entries

* /sync /usr/share/grommunio-sync php index.php | /run/php-fpm/php-grommunio-sync-fpm.sock
* /web /usr/share/grommunio-web php index.php | /run/php-fpm/php-grommunio-web-fpm.sock

NOTE: The path designated for FPM sockets varies between distributions, and because some distributions also have security policies that involve path matching (e.g. via AppArmor), we are unable to choose a path that works out-of-the-box on all distro-provided platform configurations without fail. /run/php-fpm is used as the default in line with the Grommunio Appliance.


  • config_file_path/fastcgi.txt: URI map specifying which paths this plugin shall handle.

See also

gromox(7), http(8gx)