FastCGI

Yussuf Khalil edited this page May 26, 2013 · 2 revisions

Available since Pancake 1.1.

Using FastCGI with Pancake is quite easy. First, make sure that your FastCGI upstream server is configured and running.

Then, configure Pancake. Add this to the top level configuration of Pancake:

FastCGI:
  <name>:
    type: <type>
    address: <address>
    port: <port>
    mimeTypes:
      - <mimeType1>
      - <mimeType2>
      - <...>

<name> is the name of the FastCGI configuration. You will need it later.

<type> is either "unix", "ipv4" or "ipv6", depending on whether you want to connect to the FastCGI server via unix sockets (recommended) or via Internet Protocol.

<address> In case you used "unix" as type, enter the socket file name here. For "ipv4" and "ipv6" enter the IP address the FastCGI server is listening on.

<port> is the TCP port the FastCGI server is listening on, only needed when using "ipv4" or "ipv6".

<mimeTypes> A list of valid MIME types (MIME types can be configured in mime.yml). Pancake will use the FastCGI configuration only if the MIME type of the requested file matches with one of the configured MIME types.

After having set up the FastCGI configuration, add it to your vHost's configuration file(s):

FastCGI:
  - <name>

You can add a single FastCGI configuration to as many vHosts as you want.

Now you've finished configuring FastCGI. Restart Pancake and try it out! :)