Skip to content

FastCGI Module configuration #158

@wagnert

Description

@wagnert

Actually, beside the IP and the port, all parameters of the FastCGI module are hardcoded. Additional configuration parameters, like nginx provides, are necessary. At least the following parameters has to be configurable:

  • If the request body should be passed to the FastCGI backend or not fastcgi_pass_request_body
  • If the request headers should be passed to the FastCGI backend or not fastcgi_pass_request_headers
  • Ignoring headers to be passed to the FastCGI backend or not fastcgi_ignore_headers
  • Which environment variables should be passed to the FastCGI backend fastcgi_params with the possiblity to pass them only if not empty (nginx if_not_empty flag) has to be available.

Implementation can be done based on the already used <fileHandler/> node. The params can be use to pass the configuration values, additional a new <header>node has to be introduced allow to specify the header that has to be passed, like:

<fileHandler name="fastcgi" extension=".phtml">
    <params>
        <param name="host" type="string">127.0.0.1</param>
        <param name="port" type="integer" >9010</param>
        <param name="pass_request_body" type="boolean" >true</param>
        ...
    </params>
    <headers>
        <header name="QUERY_STRING" ifNotEmpty="true"/>
    </headers>
</fileHandler>

This results in extending the <param/> node adding the additional attribute ifNotEmpty. This attribute hat the default value false, meaning that the header value will be sent to the FastCGI backend, unless it is empty or not.

A default configuration has to be provided, that allows to specify a PHP-FPM or HHVM FastCGI backend with a optimal configuration and without the need to specify any params or headers.

As we don't support variables as nginx does, the only possibility is to specify a value or NOT.

  • If NO value and NO ifNotEmpty attribute are specified, the value found in the server vars will be used. If this is also empty, an empty header will be passed.
  • If NO value and a ifNotEmpty attribute with value of true are specified, the value found in the server vars will be used and only be passed if it is NOT empty
  • If a value is specified, the ifNotEmpty attribute will NOT be considered and the value will ALWAYS be passed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions