fastcgi_param

Syntax: fastcgi_param parameter value [if_not_empty];
Default:
Context: http, server, location

Sets a parameter that should be passed to the FastCGI server. The value can contain text, variables, and their combination. These directives are inherited from the previous level if and only if there are no fastcgi_param directives defined on the current level.

The following example shows the minimum required settings for PHP:

fastcgi_param SCRIPT_FILENAME /home/www/scripts/php$fastcgi_script_name;
fastcgi_param QUERY_STRING    $query_string;

The SCRIPT_FILENAME parameter is used in PHP for determining the script name, and the QUERY_STRING parameter is used to pass request parameters.

For scripts that process POST requests, the following three parameters are also required:

fastcgi_param REQUEST_METHOD  $request_method;
fastcgi_param CONTENT_TYPE    $content_type;
fastcgi_param CONTENT_LENGTH  $content_length;

If PHP was built with the --enable-force-cgi-redirect configuration parameter, the REDIRECT_STATUS parameter should also be passed with the value “200”:

fastcgi_param REDIRECT_STATUS 200;

If the directive is specified with if_not_empty (1.1.11) then such a parameter will not be passed to the server until its value is not empty:

fastcgi_param HTTPS           $https if_not_empty;
doc_nginx
2017-02-09 07:06:10
Comments
Leave a Comment

Please login to continue.