-
Notifications
You must be signed in to change notification settings - Fork 14
Description
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_emptyflag) 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-FPMorHHVMFastCGI 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
ifNotEmptyattribute 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
ifNotEmptyattribute with value oftrueare 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
ifNotEmptyattribute will NOT be considered and the value will ALWAYS be passed.