Path: blob/main/xml/en/docs/http/ngx_http_fastcgi_module.xml
1 views
<?xml version="1.0"?>12<!--3Copyright (C) Igor Sysoev4Copyright (C) Nginx, Inc.5-->67<!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">89<module name="Module ngx_http_fastcgi_module"10link="/en/docs/http/ngx_http_fastcgi_module.html"11lang="en"12rev="56">1314<section id="summary">1516<para>17The <literal>ngx_http_fastcgi_module</literal> module allows passing18requests to a FastCGI server.19</para>2021</section>222324<section id="example" name="Example Configuration">2526<para>27<example>28location / {29fastcgi_pass localhost:9000;30fastcgi_index index.php;3132fastcgi_param SCRIPT_FILENAME /home/www/scripts/php$fastcgi_script_name;33fastcgi_param QUERY_STRING $query_string;34fastcgi_param REQUEST_METHOD $request_method;35fastcgi_param CONTENT_TYPE $content_type;36fastcgi_param CONTENT_LENGTH $content_length;37}38</example>39</para>4041</section>424344<section id="directives" name="Directives">4546<directive name="fastcgi_allow_upstream">47<syntax><value>string</value> ...</syntax>48<default/>49<context>http</context>50<context>server</context>51<context>location</context>52<appeared-in>1.29.3</appeared-in>5354<para>55Defines conditions under which access to a FastCGI server56is allowed or <link id="denied">denied</link>.57If all string parameters are not empty58and not equal to “0” then the access is allowed.59The conditions are evaluated each time60before a connection to a FastCGI server is established.61Parameter values can contain variables:62<example>63geo $upstream_last_addr $allow {64volatile;6510.10.0.0/24 1;66}6768server {69listen 127.0.0.1:8080;7071location / {72fastcgi_pass localhost:9000;73fastcgi_allow_upstream $allow;74...75}76}77</example>78</para>7980<para>81<note>82This directive is available as part of our83<commercial_version>commercial subscription</commercial_version>.84</note>85</para>8687</directive>888990<directive name="fastcgi_bind">91<syntax>92<value>address</value>93[<literal>transparent</literal>] |94<literal>off</literal></syntax>95<default/>96<context>http</context>97<context>server</context>98<context>location</context>99<appeared-in>0.8.22</appeared-in>100101<para>102Makes outgoing connections to a FastCGI server originate103from the specified local IP address with an optional port (1.11.2).104Parameter value can contain variables (1.3.12).105The special value <literal>off</literal> (1.3.12) cancels the effect106of the <literal>fastcgi_bind</literal> directive107inherited from the previous configuration level, which allows the108system to auto-assign the local IP address and port.109</para>110111<para id="fastcgi_bind_transparent">112The <literal>transparent</literal> parameter (1.11.0) allows113outgoing connections to a FastCGI server originate114from a non-local IP address,115for example, from a real IP address of a client:116<example>117fastcgi_bind $remote_addr transparent;118</example>119In order for this parameter to work,120it is usually necessary to run nginx worker processes with the121<link doc="../ngx_core_module.xml" id="user">superuser</link> privileges.122On Linux it is not required (1.13.8) as if123the <literal>transparent</literal> parameter is specified, worker processes124inherit the <literal>CAP_NET_RAW</literal> capability from the master process.125It is also necessary to configure kernel routing table126to intercept network traffic from the FastCGI server.127</para>128129</directive>130131132<directive name="fastcgi_bind_dynamic">133<syntax><literal>on</literal> | <literal>off</literal></syntax>134<default>off</default>135<context>http</context>136<context>server</context>137<context>location</context>138<appeared-in>1.29.3</appeared-in>139140<para>141When enabled, makes the <link id="fastcgi_bind">bind</link> operation142at each connection attempt.143</para>144145<para>146<note>147This directive is available as part of our148<commercial_version>commercial subscription</commercial_version>.149</note>150</para>151152</directive>153154155<directive name="fastcgi_buffer_size">156<syntax><value>size</value></syntax>157<default>4k|8k</default>158<context>http</context>159<context>server</context>160<context>location</context>161162<para>163Sets the <value>size</value> of the buffer used for reading the first part164of the response received from the FastCGI server.165This part usually contains a small response header;166if it exceeds the buffer size, the response is considered167<link id="invalid_header">invalid</link>.168By default, the buffer size is equal to one memory page.169This is either 4K or 8K, depending on a platform.170It can be made smaller, however.171</para>172173</directive>174175176<directive name="fastcgi_buffering">177<syntax><literal>on</literal> | <literal>off</literal></syntax>178<default>on</default>179<context>http</context>180<context>server</context>181<context>location</context>182<appeared-in>1.5.6</appeared-in>183184<para>185Enables or disables buffering of responses from the FastCGI server.186</para>187188<para>189When buffering is enabled, nginx receives a response from the FastCGI server190as soon as possible, saving it into the buffers set by the191<link id="fastcgi_buffer_size"/> and <link id="fastcgi_buffers"/> directives.192If the whole response does not fit into memory, a part of it can be saved193to a <link id="fastcgi_temp_path">temporary file</link> on the disk.194Writing to temporary files is controlled by the195<link id="fastcgi_max_temp_file_size"/> and196<link id="fastcgi_temp_file_write_size"/> directives.197</para>198199<para>200When buffering is disabled, the response is passed to a client synchronously,201immediately as it is received.202nginx will not try to read the whole response from the FastCGI server.203The maximum size of the data that nginx can receive from the server204at a time is set by the <link id="fastcgi_buffer_size"/> directive.205</para>206207<para>208Buffering can also be enabled or disabled by passing209“<literal>yes</literal>” or “<literal>no</literal>” in the210<header>X-Accel-Buffering</header> response header field.211This capability can be disabled using the212<link id="fastcgi_ignore_headers"/> directive.213</para>214215</directive>216217218<directive name="fastcgi_buffers">219<syntax><value>number</value> <value>size</value></syntax>220<default>8 4k|8k</default>221<context>http</context>222<context>server</context>223<context>location</context>224225<para>226Sets the <value>number</value> and <value>size</value> of the227buffers used for reading a response from the FastCGI server,228for a single connection.229By default, the buffer size is equal to one memory page.230This is either 4K or 8K, depending on a platform.231</para>232233</directive>234235236<directive name="fastcgi_busy_buffers_size">237<syntax><value>size</value></syntax>238<default>8k|16k</default>239<context>http</context>240<context>server</context>241<context>location</context>242243<para>244When <link id="fastcgi_buffering">buffering</link> of responses from the FastCGI245server is enabled, limits the total <value>size</value> of buffers that246can be busy sending a response to the client while the response is not247yet fully read.248In the meantime, the rest of the buffers can be used for reading the response249and, if needed, buffering part of the response to a temporary file.250By default, <value>size</value> is limited by the size of two buffers set by the251<link id="fastcgi_buffer_size"/> and <link id="fastcgi_buffers"/> directives.252</para>253254</directive>255256257<directive name="fastcgi_cache">258<syntax><value>zone</value> | <literal>off</literal></syntax>259<default>off</default>260<context>http</context>261<context>server</context>262<context>location</context>263264<para>265Defines a shared memory zone used for caching.266The same zone can be used in several places.267Parameter value can contain variables (1.7.9).268The <literal>off</literal> parameter disables caching inherited269from the previous configuration level.270</para>271272</directive>273274275<directive name="fastcgi_cache_background_update">276<syntax><literal>on</literal> | <literal>off</literal></syntax>277<default>off</default>278<context>http</context>279<context>server</context>280<context>location</context>281<appeared-in>1.11.10</appeared-in>282283<para>284Allows starting a background subrequest285to update an expired cache item,286while a stale cached response is returned to the client.287Note that it is necessary to288<link id="fastcgi_cache_use_stale_updating">allow</link>289the usage of a stale cached response when it is being updated.290</para>291292</directive>293294295<directive name="fastcgi_cache_bypass">296<syntax><value>string</value> ...</syntax>297<default/>298<context>http</context>299<context>server</context>300<context>location</context>301302<para>303Defines conditions under which the response will not be taken from a cache.304If at least one value of the string parameters is not empty and is not305equal to “0” then the response will not be taken from the cache:306<example>307fastcgi_cache_bypass $cookie_nocache $arg_nocache$arg_comment;308fastcgi_cache_bypass $http_pragma $http_authorization;309</example>310Can be used along with the <link id="fastcgi_no_cache"/> directive.311</para>312313</directive>314315316<directive name="fastcgi_cache_key">317<syntax><value>string</value></syntax>318<default/>319<context>http</context>320<context>server</context>321<context>location</context>322323<para>324Defines a key for caching, for example325<example>326fastcgi_cache_key localhost:9000$request_uri;327</example>328</para>329330</directive>331332333<directive name="fastcgi_cache_lock">334<syntax><literal>on</literal> | <literal>off</literal></syntax>335<default>off</default>336<context>http</context>337<context>server</context>338<context>location</context>339<appeared-in>1.1.12</appeared-in>340341<para>342When enabled, only one request at a time will be allowed to populate343a new cache element identified according to the <link id="fastcgi_cache_key"/>344directive by passing a request to a FastCGI server.345Other requests of the same cache element will either wait346for a response to appear in the cache or the cache lock for347this element to be released, up to the time set by the348<link id="fastcgi_cache_lock_timeout"/> directive.349</para>350351</directive>352353354<directive name="fastcgi_cache_lock_age">355<syntax><value>time</value></syntax>356<default>5s</default>357<context>http</context>358<context>server</context>359<context>location</context>360<appeared-in>1.7.8</appeared-in>361362<para>363If the last request passed to the FastCGI server364for populating a new cache element365has not completed for the specified <value>time</value>,366one more request may be passed to the FastCGI server.367</para>368369</directive>370371372<directive name="fastcgi_cache_lock_timeout">373<syntax><value>time</value></syntax>374<default>5s</default>375<context>http</context>376<context>server</context>377<context>location</context>378<appeared-in>1.1.12</appeared-in>379380<para>381Sets a timeout for <link id="fastcgi_cache_lock"/>.382When the <value>time</value> expires,383the request will be passed to the FastCGI server,384however, the response will not be cached.385<note>386Before 1.7.8, the response could be cached.387</note>388</para>389390</directive>391392393<directive name="fastcgi_cache_max_range_offset">394<syntax><value>number</value></syntax>395<default/>396<context>http</context>397<context>server</context>398<context>location</context>399<appeared-in>1.11.6</appeared-in>400401<para>402Sets an offset in bytes for byte-range requests.403If the range is beyond the offset,404the range request will be passed to the FastCGI server405and the response will not be cached.406</para>407408</directive>409410411<directive name="fastcgi_cache_methods">412<syntax>413<literal>GET</literal> |414<literal>HEAD</literal> |415<literal>POST</literal>416...</syntax>417<default>GET HEAD</default>418<context>http</context>419<context>server</context>420<context>location</context>421<appeared-in>0.7.59</appeared-in>422423<para>424If the client request method is listed in this directive then425the response will be cached.426“<literal>GET</literal>” and “<literal>HEAD</literal>” methods are always427added to the list, though it is recommended to specify them explicitly.428See also the <link id="fastcgi_no_cache"/> directive.429</para>430431</directive>432433434<directive name="fastcgi_cache_min_uses">435<syntax><value>number</value></syntax>436<default>1</default>437<context>http</context>438<context>server</context>439<context>location</context>440441<para>442Sets the <value>number</value> of requests after which the response443will be cached.444</para>445446</directive>447448449<directive name="fastcgi_cache_path">450<syntax>451<value>path</value>452[<literal>levels</literal>=<value>levels</value>]453[<literal>use_temp_path</literal>=<literal>on</literal>|<literal>off</literal>]454<literal>keys_zone</literal>=<value>name</value>:<value>size</value>455[<literal>inactive</literal>=<value>time</value>]456[<literal>max_size</literal>=<value>size</value>]457[<literal>min_free</literal>=<value>size</value>]458[<literal>manager_files</literal>=<value>number</value>]459[<literal>manager_sleep</literal>=<value>time</value>]460[<literal>manager_threshold</literal>=<value>time</value>]461[<literal>loader_files</literal>=<value>number</value>]462[<literal>loader_sleep</literal>=<value>time</value>]463[<literal>loader_threshold</literal>=<value>time</value>]464[<literal>purger</literal>=<literal>on</literal>|<literal>off</literal>]465[<literal>purger_files</literal>=<value>number</value>]466[<literal>purger_sleep</literal>=<value>time</value>]467[<literal>purger_threshold</literal>=<value>time</value>]</syntax>468<default/>469<context>http</context>470471<para>472Sets the path and other parameters of a cache.473Cache data are stored in files.474Both the key and file name in a cache are a result of475applying the MD5 function to the proxied URL.476477The <literal>levels</literal> parameter defines hierarchy levels of a cache:478from 1 to 3, each level accepts values 1 or 2.479For example, in the following configuration480<example>481fastcgi_cache_path /data/nginx/cache levels=1:2 keys_zone=one:10m;482</example>483file names in a cache will look like this:484<example>485/data/nginx/cache/<emphasis>c</emphasis>/<emphasis>29</emphasis>/b7f54b2df7773722d382f4809d650<emphasis>29c</emphasis>486</example>487</para>488489<para>490A cached response is first written to a temporary file,491and then the file is renamed.492Starting from version 0.8.9, temporary files and the cache can be put on493different file systems.494However, be aware that in this case a file is copied495across two file systems instead of the cheap renaming operation.496It is thus recommended that for any given location both cache and a directory497holding temporary files498are put on the same file system.499A directory for temporary files is set based on500the <literal>use_temp_path</literal> parameter (1.7.10).501If this parameter is omitted or set to the value <literal>on</literal>,502the directory set by the <link id="fastcgi_temp_path"/> directive503for the given location will be used.504If the value is set to <literal>off</literal>,505temporary files will be put directly in the cache directory.506</para>507508<para>509In addition, all active keys and information about data are stored510in a shared memory zone, whose <value>name</value> and <value>size</value>511are configured by the <literal>keys_zone</literal> parameter.512One megabyte zone can store about 8 thousand keys.513<note>514As part of515<commercial_version>commercial subscription</commercial_version>,516the shared memory zone also stores extended517cache <link doc="ngx_http_api_module.xml" id="http_caches_">information</link>,518thus, it is required to specify a larger zone size for the same number of keys.519For example,520one megabyte zone can store about 4 thousand keys.521</note>522</para>523524<para>525Cached data that are not accessed during the time specified by the526<literal>inactive</literal> parameter get removed from the cache527regardless of their freshness.528By default, <literal>inactive</literal> is set to 10 minutes.529</para>530531<para id="fastcgi_cache_path_max_size">532The special “cache manager” process monitors the maximum cache size set533by the <literal>max_size</literal> parameter,534and the minimum amount of free space set535by the <literal>min_free</literal> (1.19.1) parameter536on the file system with cache.537When the size is exceeded or there is not enough free space,538it removes the least recently used data.539The data is removed in iterations configured by540<literal>manager_files</literal>,541<literal>manager_threshold</literal>, and542<literal>manager_sleep</literal> parameters (1.11.5).543During one iteration no more than <literal>manager_files</literal> items544are deleted (by default, 100).545The duration of one iteration is limited by the546<literal>manager_threshold</literal> parameter (by default, 200 milliseconds).547Between iterations, a pause configured by the <literal>manager_sleep</literal>548parameter (by default, 50 milliseconds) is made.549</para>550551<para>552A minute after the start the special “cache loader” process is activated.553It loads information about previously cached data stored on file system554into a cache zone.555The loading is also done in iterations.556During one iteration no more than <literal>loader_files</literal> items557are loaded (by default, 100).558Besides, the duration of one iteration is limited by the559<literal>loader_threshold</literal> parameter (by default, 200 milliseconds).560Between iterations, a pause configured by the <literal>loader_sleep</literal>561parameter (by default, 50 milliseconds) is made.562</para>563564<para>565Additionally,566the following parameters are available as part of our567<commercial_version>commercial subscription</commercial_version>:568</para>569570<para>571<list type="tag">572573<tag-name id="purger">574<literal>purger</literal>=<literal>on</literal>|<literal>off</literal>575</tag-name>576<tag-desc>577Instructs whether cache entries that match a578<link id="fastcgi_cache_purge">wildcard key</link>579will be removed from the disk by the cache purger (1.7.12).580Setting the parameter to <literal>on</literal>581(default is <literal>off</literal>)582will activate the “cache purger” process that583permanently iterates through all cache entries584and deletes the entries that match the wildcard key.585</tag-desc>586587<tag-name id="purger_files">588<literal>purger_files</literal>=<value>number</value>589</tag-name>590<tag-desc>591Sets the number of items that will be scanned during one iteration (1.7.12).592By default, <literal>purger_files</literal> is set to 10.593</tag-desc>594595<tag-name id="purger_threshold">596<literal>purger_threshold</literal>=<value>number</value>597</tag-name>598<tag-desc>599Sets the duration of one iteration (1.7.12).600By default, <literal>purger_threshold</literal> is set to 50 milliseconds.601</tag-desc>602603<tag-name id="purger_sleep">604<literal>purger_sleep</literal>=<value>number</value>605</tag-name>606<tag-desc>607Sets a pause between iterations (1.7.12).608By default, <literal>purger_sleep</literal> is set to 50 milliseconds.609</tag-desc>610611</list>612</para>613614<para>615<note>616In versions 1.7.3, 1.7.7, and 1.11.10 cache header format has been changed.617Previously cached responses will be considered invalid618after upgrading to a newer nginx version.619</note>620</para>621622</directive>623624625<directive name="fastcgi_cache_purge">626<syntax>string ...</syntax>627<default/>628<context>http</context>629<context>server</context>630<context>location</context>631<appeared-in>1.5.7</appeared-in>632633<para>634Defines conditions under which the request will be considered a cache635purge request.636If at least one value of the string parameters is not empty and is not equal637to “0” then the cache entry with a corresponding638<link id="fastcgi_cache_key">cache key</link> is removed.639The result of successful operation is indicated by returning640the <http-status code="204" text="No Content"/> response.641</para>642643<para>644If the <link id="fastcgi_cache_key">cache key</link> of a purge request ends645with an asterisk (“<literal>*</literal>”), all cache entries matching the646wildcard key will be removed from the cache.647However, these entries will remain on the disk until they are deleted648for either <link id="fastcgi_cache_path">inactivity</link>,649or processed by the <link id="purger">cache purger</link> (1.7.12),650or a client attempts to access them.651</para>652653<para>654Example configuration:655<example>656fastcgi_cache_path /data/nginx/cache keys_zone=cache_zone:10m;657658map $request_method $purge_method {659PURGE 1;660default 0;661}662663server {664...665location / {666fastcgi_pass backend;667fastcgi_cache cache_zone;668fastcgi_cache_key $uri;669fastcgi_cache_purge $purge_method;670}671}672</example>673<note>674This functionality is available as part of our675<commercial_version>commercial subscription</commercial_version>.676</note>677</para>678679</directive>680681682<directive name="fastcgi_cache_revalidate">683<syntax><literal>on</literal> | <literal>off</literal></syntax>684<default>off</default>685<context>http</context>686<context>server</context>687<context>location</context>688<appeared-in>1.5.7</appeared-in>689690<para>691Enables revalidation of expired cache items using conditional requests with692the <header>If-Modified-Since</header> and <header>If-None-Match</header>693header fields.694</para>695696</directive>697698699<directive name="fastcgi_cache_use_stale">700<syntax>701<literal>error</literal> |702<literal>timeout</literal> |703<literal>invalid_header</literal> |704<literal>updating</literal> |705<literal>http_500</literal> |706<literal>http_503</literal> |707<literal>http_403</literal> |708<literal>http_404</literal> |709<literal>http_429</literal> |710<literal>off</literal>711...</syntax>712<default>off</default>713<context>http</context>714<context>server</context>715<context>location</context>716717<para>718Determines in which cases a stale cached response can be used719when an error occurs during communication with the FastCGI server.720The directive’s parameters match the parameters of the721<link id="fastcgi_next_upstream"/> directive.722</para>723724<para>725The <literal>error</literal> parameter also permits726using a stale cached response if a FastCGI server to process a request727cannot be selected.728</para>729730<para id="fastcgi_cache_use_stale_updating">731Additionally, the <literal>updating</literal> parameter permits732using a stale cached response if it is currently being updated.733This allows minimizing the number of accesses to FastCGI servers734when updating cached data.735</para>736737<para>738Using a stale cached response739can also be enabled directly in the response header740for a specified number of seconds after the response became stale (1.11.10).741This has lower priority than using the directive parameters.742<list type="bullet" compact="no">743744<listitem>745The746“<link url="https://datatracker.ietf.org/doc/html/rfc5861#section-3">stale-while-revalidate</link>”747extension of the <header>Cache-Control</header> header field permits748using a stale cached response if it is currently being updated.749</listitem>750751<listitem>752The753“<link url="https://datatracker.ietf.org/doc/html/rfc5861#section-4">stale-if-error</link>”754extension of the <header>Cache-Control</header> header field permits755using a stale cached response in case of an error.756</listitem>757758</list>759</para>760761<para>762To minimize the number of accesses to FastCGI servers when763populating a new cache element, the <link id="fastcgi_cache_lock"/>764directive can be used.765</para>766767</directive>768769770<directive name="fastcgi_cache_valid">771<syntax>[<value>code</value> ...] <value>time</value></syntax>772<default/>773<context>http</context>774<context>server</context>775<context>location</context>776777<para>778Sets caching time for different response codes.779For example, the following directives780<example>781fastcgi_cache_valid 200 302 10m;782fastcgi_cache_valid 404 1m;783</example>784set 10 minutes of caching for responses with codes 200 and 302785and 1 minute for responses with code 404.786</para>787788<para>789If only caching <value>time</value> is specified790<example>791fastcgi_cache_valid 5m;792</example>793then only 200, 301, and 302 responses are cached.794</para>795796<para>797In addition, the <literal>any</literal> parameter can be specified798to cache any responses:799<example>800fastcgi_cache_valid 200 302 10m;801fastcgi_cache_valid 301 1h;802fastcgi_cache_valid any 1m;803</example>804</para>805806<para>807Parameters of caching can also be set directly808in the response header.809This has higher priority than setting of caching time using the directive.810<list type="bullet" compact="no">811812<listitem>813The <header>X-Accel-Expires</header> header field sets caching time of a814response in seconds.815The zero value disables caching for a response.816If the value starts with the <literal>@</literal> prefix, it sets an absolute817time in seconds since Epoch, up to which the response may be cached.818</listitem>819820<listitem>821If the header does not include the <header>X-Accel-Expires</header> field,822parameters of caching may be set in the header fields823<header>Expires</header> or <header>Cache-Control</header>.824</listitem>825826<listitem>827If the header includes the <header>Set-Cookie</header> field, such a828response will not be cached.829</listitem>830831<listitem>832If the header includes the <header>Vary</header> field833with the special value “<literal>*</literal>”, such a834response will not be cached (1.7.7).835If the header includes the <header>Vary</header> field836with another value, such a response will be cached837taking into account the corresponding request header fields (1.7.7).838</listitem>839840</list>841Processing of one or more of these response header fields can be disabled842using the <link id="fastcgi_ignore_headers"/> directive.843</para>844845</directive>846847848<directive name="fastcgi_catch_stderr">849<syntax><value>string</value></syntax>850<default/>851<context>http</context>852<context>server</context>853<context>location</context>854855<para>856Sets a string to search for in the error stream of a response857received from a FastCGI server.858If the <value>string</value> is found then it is considered that the FastCGI859server has returned an <link id="fastcgi_next_upstream">invalid response</link>.860This allows handling application errors in nginx, for example:861<example>862location /php/ {863fastcgi_pass backend:9000;864...865fastcgi_catch_stderr "PHP Fatal error";866fastcgi_next_upstream error timeout invalid_header;867}868</example>869</para>870871</directive>872873874<directive name="fastcgi_connect_timeout">875<syntax><value>time</value></syntax>876<default>60s</default>877<context>http</context>878<context>server</context>879<context>location</context>880881<para>882Defines a timeout for establishing a connection with a FastCGI server.883It should be noted that this timeout cannot usually exceed 75 seconds.884</para>885886</directive>887888889<directive name="fastcgi_force_ranges">890<syntax><literal>on</literal> | <literal>off</literal></syntax>891<default>off</default>892<context>http</context>893<context>server</context>894<context>location</context>895<appeared-in>1.7.7</appeared-in>896897<para>898Enables byte-range support899for both cached and uncached responses from the FastCGI server900regardless of the <header>Accept-Ranges</header> field in these responses.901</para>902903</directive>904905906<directive name="fastcgi_hide_header">907<syntax><value>field</value></syntax>908<default/>909<context>http</context>910<context>server</context>911<context>location</context>912913<para>914By default,915nginx does not pass the header fields <header>Status</header> and916<header>X-Accel-...</header> from the response of a FastCGI917server to a client.918The <literal>fastcgi_hide_header</literal> directive sets additional fields919that will not be passed.920If, on the contrary, the passing of fields needs to be permitted,921the <link id="fastcgi_pass_header"/> directive can be used.922</para>923924</directive>925926927<directive name="fastcgi_ignore_client_abort">928<syntax><literal>on</literal> | <literal>off</literal></syntax>929<default>off</default>930<context>http</context>931<context>server</context>932<context>location</context>933934<para>935Determines whether the connection with a FastCGI server should be936closed when a client closes the connection without waiting937for a response.938</para>939940</directive>941942943<directive name="fastcgi_ignore_headers">944<syntax><value>field</value> ...</syntax>945<default/>946<context>http</context>947<context>server</context>948<context>location</context>949950<para>951Disables processing of certain response header fields from the FastCGI server.952The following fields can be ignored: <header>X-Accel-Redirect</header>,953<header>X-Accel-Expires</header>, <header>X-Accel-Limit-Rate</header> (1.1.6),954<header>X-Accel-Buffering</header> (1.1.6),955<header>X-Accel-Charset</header> (1.1.6), <header>Expires</header>,956<header>Cache-Control</header>, <header>Set-Cookie</header> (0.8.44),957and <header>Vary</header> (1.7.7).958</para>959960<para>961If not disabled, processing of these header fields has the following962effect:963<list type="bullet" compact="no">964965<listitem>966<header>X-Accel-Expires</header>, <header>Expires</header>,967<header>Cache-Control</header>, <header>Set-Cookie</header>,968and <header>Vary</header>969set the parameters of response <link id="fastcgi_cache_valid">caching</link>;970</listitem>971972<listitem>973<header>X-Accel-Redirect</header> performs an974<link doc="ngx_http_core_module.xml" id="internal">internal975redirect</link> to the specified URI;976</listitem>977978<listitem>979<header>X-Accel-Limit-Rate</header> sets the980<link doc="ngx_http_core_module.xml" id="limit_rate">rate981limit</link> for transmission of a response to a client;982</listitem>983984<listitem>985<header>X-Accel-Buffering</header> enables or disables986<link id="fastcgi_buffering">buffering</link> of a response;987</listitem>988989<listitem>990<header>X-Accel-Charset</header> sets the desired991<link doc="ngx_http_charset_module.xml" id="charset"/>992of a response.993</listitem>994995</list>996</para>997998</directive>99910001001<directive name="fastcgi_index">1002<syntax><value>name</value></syntax>1003<default/>1004<context>http</context>1005<context>server</context>1006<context>location</context>10071008<para>1009Sets a file name that will be appended after a URI that ends with1010a slash, in the value of the <var>$fastcgi_script_name</var> variable.1011For example, with these settings1012<example>1013fastcgi_index index.php;1014fastcgi_param SCRIPT_FILENAME /home/www/scripts/php$fastcgi_script_name;1015</example>1016and the “<literal>/page.php</literal>” request,1017the <literal>SCRIPT_FILENAME</literal> parameter will be equal to1018“<literal>/home/www/scripts/php/page.php</literal>”,1019and with the “<literal>/</literal>” request it will be equal to1020“<literal>/home/www/scripts/php/index.php</literal>”.1021</para>10221023</directive>102410251026<directive name="fastcgi_intercept_errors">1027<syntax><literal>on</literal> | <literal>off</literal></syntax>1028<default>off</default>1029<context>http</context>1030<context>server</context>1031<context>location</context>10321033<para>1034Determines whether FastCGI server responses with codes greater than or equal1035to 300 should be passed to a client1036or be intercepted and redirected to nginx for processing1037with the <link doc="ngx_http_core_module.xml" id="error_page"/> directive.1038</para>10391040</directive>104110421043<directive name="fastcgi_keep_conn">1044<syntax><literal>on</literal> | <literal>off</literal></syntax>1045<default>off</default>1046<context>http</context>1047<context>server</context>1048<context>location</context>1049<appeared-in>1.1.4</appeared-in>10501051<para>1052By default, a FastCGI server will close a connection right after1053sending the response.1054However, when this directive is set to the value <literal>on</literal>,1055nginx will instruct a FastCGI server to keep connections open.1056This is necessary, in particular, for1057<link doc="ngx_http_upstream_module.xml" id="keepalive"/>1058connections to FastCGI servers to function.1059</para>10601061</directive>106210631064<directive name="fastcgi_limit_rate">1065<syntax><value>rate</value></syntax>1066<default>0</default>1067<context>http</context>1068<context>server</context>1069<context>location</context>1070<appeared-in>1.7.7</appeared-in>10711072<para>1073Limits the speed of reading the response from the FastCGI server.1074The <value>rate</value> is specified in bytes per second.1075The zero value disables rate limiting.1076The limit is set per a request, and so if nginx simultaneously opens1077two connections to the FastCFI server,1078the overall rate will be twice as much as the specified limit.1079The limitation works only if1080<link id="fastcgi_buffering">buffering</link> of responses from the FastCGI1081server is enabled.1082Parameter value can contain variables (1.27.0).1083</para>10841085</directive>108610871088<directive name="fastcgi_max_temp_file_size">1089<syntax><value>size</value></syntax>1090<default>1024m</default>1091<context>http</context>1092<context>server</context>1093<context>location</context>10941095<para>1096When <link id="fastcgi_buffering">buffering</link> of responses from the FastCGI1097server is enabled, and the whole response does not fit into the buffers1098set by the <link id="fastcgi_buffer_size"/> and <link id="fastcgi_buffers"/>1099directives, a part of the response can be saved to a temporary file.1100This directive sets the maximum <value>size</value> of the temporary file.1101The size of data written to the temporary file at a time is set1102by the <link id="fastcgi_temp_file_write_size"/> directive.1103</para>11041105<para>1106The zero value disables buffering of responses to temporary files.1107</para>11081109<para>1110<note>1111This restriction does not apply to responses1112that will be <link id="fastcgi_cache">cached</link>1113or <link id="fastcgi_store">stored</link> on disk.1114</note>1115</para>11161117</directive>111811191120<directive name="fastcgi_next_upstream">1121<syntax>1122<literal>error</literal> |1123<literal>timeout</literal> |1124<literal>denied</literal> |1125<literal>invalid_header</literal> |1126<literal>http_500</literal> |1127<literal>http_503</literal> |1128<literal>http_403</literal> |1129<literal>http_404</literal> |1130<literal>http_429</literal> |1131<literal>non_idempotent</literal> |1132<literal>off</literal>1133...</syntax>1134<default>error timeout</default>1135<context>http</context>1136<context>server</context>1137<context>location</context>11381139<para>1140Specifies in which cases a request should be passed to the next server:1141<list type="tag">11421143<tag-name><literal>error</literal></tag-name>1144<tag-desc>an error occurred while establishing a connection with the1145server, passing a request to it, or reading the response header;</tag-desc>11461147<tag-name><literal>timeout</literal></tag-name>1148<tag-desc>a timeout has occurred while establishing a connection with the1149server, passing a request to it, or reading the response header;</tag-desc>11501151<tag-name id="denied"><literal>denied</literal></tag-name>1152<tag-desc>the server <link id="fastcgi_allow_upstream">denied</link>1153the connection (1.29.3);1154<para>1155<note>1156This parameter is available as part of our1157<commercial_version>commercial subscription</commercial_version>.1158</note>1159</para>1160</tag-desc>11611162<tag-name id="invalid_header"><literal>invalid_header</literal></tag-name>1163<tag-desc>a server returned an empty or invalid response;</tag-desc>11641165<tag-name><literal>http_500</literal></tag-name>1166<tag-desc>a server returned a response with the code 500;</tag-desc>11671168<tag-name><literal>http_503</literal></tag-name>1169<tag-desc>a server returned a response with the code 503;</tag-desc>11701171<tag-name><literal>http_403</literal></tag-name>1172<tag-desc>a server returned a response with the code 403;</tag-desc>11731174<tag-name><literal>http_404</literal></tag-name>1175<tag-desc>a server returned a response with the code 404;</tag-desc>11761177<tag-name><literal>http_429</literal></tag-name>1178<tag-desc>a server returned a response with the code 429 (1.11.13);</tag-desc>11791180<tag-name id="non_idempotent"><literal>non_idempotent</literal></tag-name>1181<tag-desc>normally, requests with a1182<link url="https://datatracker.ietf.org/doc/html/rfc7231#section-4.2.2">non-idempotent</link>1183method1184(<literal>POST</literal>, <literal>LOCK</literal>, <literal>PATCH</literal>)1185are not passed to the next server1186if a request has been sent to an upstream server (1.9.13);1187enabling this option explicitly allows retrying such requests;1188</tag-desc>11891190<tag-name><literal>off</literal></tag-name>1191<tag-desc>disables passing a request to the next server.</tag-desc>11921193</list>1194</para>11951196<para>1197One should bear in mind that passing a request to the next server is1198only possible if nothing has been sent to a client yet.1199That is, if an error or timeout occurs in the middle of the1200transferring of a response, fixing this is impossible.1201</para>12021203<para>1204The directive also defines what is considered an1205<link doc="ngx_http_upstream_module.xml" id="max_fails">unsuccessful1206attempt</link> of communication with a server.1207The cases of <literal>error</literal>, <literal>timeout</literal>,1208<literal>denied</literal> and1209<literal>invalid_header</literal> are always considered unsuccessful attempts,1210even if they are not specified in the directive.1211The cases of <literal>http_500</literal>, <literal>http_503</literal>,1212and <literal>http_429</literal> are1213considered unsuccessful attempts only if they are specified in the directive.1214The cases of <literal>http_403</literal> and <literal>http_404</literal>1215are never considered unsuccessful attempts.1216</para>12171218<para>1219Passing a request to the next server can be limited by1220<link id="fastcgi_next_upstream_tries">the number of tries</link>1221and by <link id="fastcgi_next_upstream_timeout">time</link>.1222</para>12231224</directive>122512261227<directive name="fastcgi_next_upstream_timeout">1228<syntax><value>time</value></syntax>1229<default>0</default>1230<context>http</context>1231<context>server</context>1232<context>location</context>1233<appeared-in>1.7.5</appeared-in>12341235<para>1236Limits the time during which a request can be passed to the1237<link id="fastcgi_next_upstream">next server</link>.1238The <literal>0</literal> value turns off this limitation.1239</para>12401241</directive>124212431244<directive name="fastcgi_next_upstream_tries">1245<syntax><value>number</value></syntax>1246<default>0</default>1247<context>http</context>1248<context>server</context>1249<context>location</context>1250<appeared-in>1.7.5</appeared-in>12511252<para>1253Limits the number of possible tries for passing a request to the1254<link id="fastcgi_next_upstream">next server</link>.1255The <literal>0</literal> value turns off this limitation.1256</para>12571258</directive>125912601261<directive name="fastcgi_no_cache">1262<syntax><value>string</value> ...</syntax>1263<default/>1264<context>http</context>1265<context>server</context>1266<context>location</context>12671268<para>1269Defines conditions under which the response will not be saved to a cache.1270If at least one value of the string parameters is not empty and is not1271equal to “0” then the response will not be saved:1272<example>1273fastcgi_no_cache $cookie_nocache $arg_nocache$arg_comment;1274fastcgi_no_cache $http_pragma $http_authorization;1275</example>1276Can be used along with the <link id="fastcgi_cache_bypass"/> directive.1277</para>12781279</directive>128012811282<directive name="fastcgi_param">1283<syntax>1284<value>parameter</value> <value>value</value>1285[<literal>if_not_empty</literal>]</syntax>1286<default>HTTP_HOST $host$is_request_port$request_port</default>1287<context>http</context>1288<context>server</context>1289<context>location</context>12901291<para>1292Sets a <value>parameter</value> that should be passed to the FastCGI server.1293The <value>value</value> can contain text, variables, and their combination.1294These directives are inherited from the previous configuration level1295if and only if there are no <literal>fastcgi_param</literal> directives1296defined on the current level.1297</para>12981299<para>1300The following example shows the minimum required settings for PHP:1301<example>1302fastcgi_param SCRIPT_FILENAME /home/www/scripts/php$fastcgi_script_name;1303fastcgi_param QUERY_STRING $query_string;1304</example>1305</para>13061307<para>1308The <literal>SCRIPT_FILENAME</literal> parameter is used in PHP for1309determining the script name, and the <literal>QUERY_STRING</literal>1310parameter is used to pass request parameters.1311</para>13121313<para>1314For scripts that process <literal>POST</literal> requests, the1315following three parameters are also required:1316<example>1317fastcgi_param REQUEST_METHOD $request_method;1318fastcgi_param CONTENT_TYPE $content_type;1319fastcgi_param CONTENT_LENGTH $content_length;1320</example>1321</para>13221323<para>1324If PHP was built with the <literal>--enable-force-cgi-redirect</literal>1325configuration parameter, the <literal>REDIRECT_STATUS</literal> parameter1326should also be passed with the value “200”:1327<example>1328fastcgi_param REDIRECT_STATUS 200;1329</example>1330</para>13311332<para>1333If the directive is specified with <literal>if_not_empty</literal> (1.1.11) then1334such a parameter will be passed to the server only if its value is not empty:1335<example>1336fastcgi_param HTTPS $https if_not_empty;1337</example>1338</para>13391340</directive>134113421343<directive name="fastcgi_pass">1344<syntax><value>address</value></syntax>1345<default/>1346<context>location</context>1347<context>if in location</context>13481349<para>1350Sets the address of a FastCGI server.1351The address can be specified as a domain name or IP address,1352and a port:1353<example>1354fastcgi_pass localhost:9000;1355</example>1356or as a UNIX-domain socket path:1357<example>1358fastcgi_pass unix:/tmp/fastcgi.socket;1359</example>1360</para>13611362<para>1363If a domain name resolves to several addresses, all of them will be1364used in a round-robin fashion.1365In addition, an address can be specified as a1366<link doc="ngx_http_upstream_module.xml">server group</link>.1367</para>13681369<para>1370Parameter value can contain variables.1371In this case, if an address is specified as a domain name,1372the name is searched among the described1373<link doc="ngx_http_upstream_module.xml">server groups</link>,1374and, if not found, is determined using a1375<link doc="ngx_http_core_module.xml" id="resolver"/>.1376</para>13771378</directive>137913801381<directive name="fastcgi_pass_header">1382<syntax><value>field</value></syntax>1383<default/>1384<context>http</context>1385<context>server</context>1386<context>location</context>13871388<para>1389Permits passing <link id="fastcgi_hide_header">otherwise disabled</link> header1390fields from a FastCGI server to a client.1391</para>13921393</directive>139413951396<directive name="fastcgi_pass_request_body">1397<syntax><literal>on</literal> | <literal>off</literal></syntax>1398<default>on</default>1399<context>http</context>1400<context>server</context>1401<context>location</context>14021403<para>1404Indicates whether the original request body is passed1405to the FastCGI server.1406See also the <link id="fastcgi_pass_request_headers"/> directive.1407</para>14081409</directive>141014111412<directive name="fastcgi_pass_request_headers">1413<syntax><literal>on</literal> | <literal>off</literal></syntax>1414<default>on</default>1415<context>http</context>1416<context>server</context>1417<context>location</context>14181419<para>1420Indicates whether the header fields of the original request are passed1421to the FastCGI server.1422See also the <link id="fastcgi_pass_request_body"/> directive.1423</para>14241425</directive>142614271428<directive name="fastcgi_read_timeout">1429<syntax><value>time</value></syntax>1430<default>60s</default>1431<context>http</context>1432<context>server</context>1433<context>location</context>14341435<para>1436Defines a timeout for reading a response from the FastCGI server.1437The timeout is set only between two successive read operations,1438not for the transmission of the whole response.1439If the FastCGI server does not transmit anything within this time,1440the connection is closed.1441</para>14421443</directive>144414451446<directive name="fastcgi_request_buffering">1447<syntax><literal>on</literal> | <literal>off</literal></syntax>1448<default>on</default>1449<context>http</context>1450<context>server</context>1451<context>location</context>1452<appeared-in>1.7.11</appeared-in>14531454<para>1455Enables or disables buffering of a client request body.1456</para>14571458<para>1459When buffering is enabled, the entire request body is1460<link doc="ngx_http_core_module.xml" id="client_body_buffer_size">read</link>1461from the client before sending the request to a FastCGI server.1462</para>14631464<para>1465When buffering is disabled, the request body is sent to the FastCGI server1466immediately as it is received.1467In this case, the request cannot be passed to the1468<link id="fastcgi_next_upstream">next server</link>1469if nginx already started sending the request body.1470</para>14711472</directive>147314741475<directive name="fastcgi_request_dynamic">1476<syntax><literal>on</literal> | <literal>off</literal></syntax>1477<default>off</default>1478<context>http</context>1479<context>server</context>1480<context>location</context>1481<appeared-in>1.29.3</appeared-in>14821483<para>1484Enables or disables creation of a separate request instance1485for each FastCGI server.1486By default, a single request is used for all FastCGI servers.1487If enabled, a separate request instance is created,1488allowing per-server request customization.1489</para>14901491<para>1492<note>1493This directive is available as part of our1494<commercial_version>commercial subscription</commercial_version>.1495</note>1496</para>14971498</directive>149915001501<directive name="fastcgi_send_lowat">1502<syntax><value>size</value></syntax>1503<default>0</default>1504<context>http</context>1505<context>server</context>1506<context>location</context>15071508<para>1509If the directive is set to a non-zero value, nginx will try to1510minimize the number1511of send operations on outgoing connections to a FastCGI server by using either1512<c-def>NOTE_LOWAT</c-def> flag of the1513<link doc="../events.xml" id="kqueue"/> method,1514or the <c-def>SO_SNDLOWAT</c-def> socket option,1515with the specified <value>size</value>.1516</para>15171518<para>1519This directive is ignored on Linux, Solaris, and Windows.1520</para>15211522</directive>152315241525<directive name="fastcgi_send_timeout">1526<syntax><value>time</value></syntax>1527<default>60s</default>1528<context>http</context>1529<context>server</context>1530<context>location</context>15311532<para>1533Sets a timeout for transmitting a request to the FastCGI server.1534The timeout is set only between two successive write operations,1535not for the transmission of the whole request.1536If the FastCGI server does not receive anything within this time,1537the connection is closed.1538</para>15391540</directive>154115421543<directive name="fastcgi_socket_keepalive">1544<syntax><literal>on</literal> | <literal>off</literal></syntax>1545<default>off</default>1546<context>http</context>1547<context>server</context>1548<context>location</context>1549<appeared-in>1.15.6</appeared-in>15501551<para>1552Configures the “TCP keepalive” behavior1553for outgoing connections to a FastCGI server.1554By default, the operating system’s settings are in effect for the socket.1555If the directive is set to the value “<literal>on</literal>”, the1556<c-def>SO_KEEPALIVE</c-def> socket option is turned on for the socket.1557</para>15581559</directive>156015611562<directive name="fastcgi_split_path_info">1563<syntax><value>regex</value></syntax>1564<default/>1565<context>location</context>15661567<para>1568Defines a regular expression that captures a value for the1569<var>$fastcgi_path_info</var> variable.1570The regular expression should have two captures: the first becomes1571a value of the <var>$fastcgi_script_name</var> variable, the second1572becomes a value of the <var>$fastcgi_path_info</var> variable.1573For example, with these settings1574<example>1575location ~ ^(.+\.php)(.*)$ {1576fastcgi_split_path_info ^(.+\.php)(.*)$;1577fastcgi_param SCRIPT_FILENAME /path/to/php$fastcgi_script_name;1578fastcgi_param PATH_INFO $fastcgi_path_info;1579</example>1580and the “<literal>/show.php/article/0001</literal>” request,1581the <literal>SCRIPT_FILENAME</literal> parameter will be equal to1582“<literal>/path/to/php/show.php</literal>”, and the1583<literal>PATH_INFO</literal> parameter will be equal to1584“<literal>/article/0001</literal>”.1585</para>15861587</directive>158815891590<directive name="fastcgi_store">1591<syntax>1592<literal>on</literal> |1593<literal>off</literal> |1594<value>string</value></syntax>1595<default>off</default>1596<context>http</context>1597<context>server</context>1598<context>location</context>15991600<para>1601Enables saving of files to a disk.1602The <literal>on</literal> parameter saves files with paths1603corresponding to the directives1604<link doc="ngx_http_core_module.xml" id="alias"/> or1605<link doc="ngx_http_core_module.xml" id="root"/>.1606The <literal>off</literal> parameter disables saving of files.1607In addition, the file name can be set explicitly using the1608<value>string</value> with variables:1609<example>1610fastcgi_store /data/www$original_uri;1611</example>1612</para>16131614<para>1615The modification time of files is set according to the received1616<header>Last-Modified</header> response header field.1617The response is first written to a temporary file,1618and then the file is renamed.1619Starting from version 0.8.9, temporary files and the persistent store1620can be put on different file systems.1621However, be aware that in this case a file is copied1622across two file systems instead of the cheap renaming operation.1623It is thus recommended that for any given location both saved files and a1624directory holding temporary files, set by the <link id="fastcgi_temp_path"/>1625directive, are put on the same file system.1626</para>16271628<para>1629This directive can be used to create local copies of static unchangeable1630files, e.g.:1631<example>1632location /images/ {1633root /data/www;1634error_page 404 = /fetch$uri;1635}16361637location /fetch/ {1638internal;16391640fastcgi_pass backend:9000;1641...16421643fastcgi_store on;1644fastcgi_store_access user:rw group:rw all:r;1645fastcgi_temp_path /data/temp;16461647alias /data/www/;1648}1649</example>1650</para>16511652</directive>165316541655<directive name="fastcgi_store_access">1656<syntax><value>users</value>:<value>permissions</value> ...</syntax>1657<default>user:rw</default>1658<context>http</context>1659<context>server</context>1660<context>location</context>16611662<para>1663Sets access permissions for newly created files and directories, e.g.:1664<example>1665fastcgi_store_access user:rw group:rw all:r;1666</example>1667</para>16681669<para>1670If any <literal>group</literal> or <literal>all</literal> access permissions1671are specified then <literal>user</literal> permissions may be omitted:1672<example>1673fastcgi_store_access group:rw all:r;1674</example>1675</para>16761677</directive>167816791680<directive name="fastcgi_temp_file_write_size">1681<syntax><value>size</value></syntax>1682<default>8k|16k</default>1683<context>http</context>1684<context>server</context>1685<context>location</context>16861687<para>1688Limits the <value>size</value> of data written to a temporary file1689at a time, when buffering of responses from the FastCGI server1690to temporary files is enabled.1691By default, <value>size</value> is limited by two buffers set by the1692<link id="fastcgi_buffer_size"/> and <link id="fastcgi_buffers"/> directives.1693The maximum size of a temporary file is set by the1694<link id="fastcgi_max_temp_file_size"/> directive.1695</para>16961697</directive>169816991700<directive name="fastcgi_temp_path">1701<syntax>1702<value>path</value>1703[<value>level1</value>1704[<value>level2</value>1705[<value>level3</value>]]]</syntax>1706<default>fastcgi_temp</default>1707<context>http</context>1708<context>server</context>1709<context>location</context>17101711<para>1712Defines a directory for storing temporary files1713with data received from FastCGI servers.1714Up to three-level subdirectory hierarchy can be used underneath the specified1715directory.1716For example, in the following configuration1717<example>1718fastcgi_temp_path /spool/nginx/fastcgi_temp 1 2;1719</example>1720a temporary file might look like this:1721<example>1722/spool/nginx/fastcgi_temp/<emphasis>7</emphasis>/<emphasis>45</emphasis>/00000123<emphasis>457</emphasis>1723</example>1724</para>17251726<para>1727See also the <literal>use_temp_path</literal> parameter of the1728<link id="fastcgi_cache_path"/> directive.1729</para>17301731</directive>17321733</section>173417351736<section id="parameters" name="Parameters Passed to a FastCGI Server">17371738<para>1739HTTP request header fields are passed to a FastCGI server as parameters.1740In applications and scripts running as FastCGI servers,1741these parameters are usually made available as environment variables.1742For example, the <header>User-Agent</header> header field is passed as the1743<literal>HTTP_USER_AGENT</literal> parameter.1744In addition to HTTP request header fields, it is possible to pass arbitrary1745parameters using the <link id="fastcgi_param"/> directive.1746</para>17471748</section>174917501751<section id="variables" name="Embedded Variables">17521753<para>1754The <literal>ngx_http_fastcgi_module</literal> module supports embedded1755variables that can be used to set parameters using the1756<link id="fastcgi_param"/> directive:1757<list type="tag">17581759<tag-name id="var_fastcgi_script_name"><var>$fastcgi_script_name</var>1760</tag-name>1761<tag-desc>1762request URI or, if a URI ends with a slash, request URI with an index file1763name configured by the <link id="fastcgi_index"/> directive appended to it.1764This variable can be used to set the1765<literal>SCRIPT_FILENAME</literal> and <literal>PATH_TRANSLATED</literal>1766parameters that determine the script name in PHP.1767For example, for the “<literal>/info/</literal>” request with the1768following directives1769<example>1770fastcgi_index index.php;1771fastcgi_param SCRIPT_FILENAME /home/www/scripts/php$fastcgi_script_name;1772</example>1773the <literal>SCRIPT_FILENAME</literal> parameter will be equal to1774“<literal>/home/www/scripts/php/info/index.php</literal>”.17751776<para>1777When using the <link id="fastcgi_split_path_info"/> directive,1778the <var>$fastcgi_script_name</var> variable equals the value of1779the first capture set by the directive.1780</para>1781</tag-desc>17821783<tag-name id="var_fastcgi_path_info"><var>$fastcgi_path_info</var></tag-name>1784<tag-desc>the value of the second capture set by the1785<link id="fastcgi_split_path_info"/> directive.1786This variable can be used to set the1787<literal>PATH_INFO</literal> parameter.1788</tag-desc>17891790</list>1791</para>17921793</section>17941795</module>179617971798