Mercurial > hg > nginx-site
diff xml/en/docs/http/request_processing.xml @ 271:4c6d2c614d2c
Cleaned up XML tag mess:
- all of <parameter> and <code>, and some of <dirname>, <value>,
and <command> were replaced by <literal>;
- the rest of <dirname> were replaced by links;
- <argument> were replaced by <value>;
- <value> is now rendered in HTML in italic;
- <literal> and <path> can now contain <value>.
Cleaned up terminology mess:
- directives take "parameters".
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Fri, 23 Dec 2011 17:29:59 +0000 |
parents | 682163f2b298 |
children | 6135f3c95bf6 |
line wrap: on
line diff
--- a/xml/en/docs/http/request_processing.xml Thu Dec 22 13:39:18 2011 +0000 +++ b/xml/en/docs/http/request_processing.xml Fri Dec 23 17:29:59 2011 +0000 @@ -44,8 +44,8 @@ In the configuration above, the default server is the first one—which is nginx’s standard default behaviour. If you do not want the first server listed to be the default server, -you may set it explicitly with the <dirname>default_server</dirname> parameter -in the <dirname>listen</dirname> directive: +you may set it explicitly with the <literal>default_server</literal> parameter +in the <link doc="ngx_http_core_module.xml" id="listen"/> directive: <programlisting> server { @@ -56,9 +56,9 @@ </programlisting> <note> -The <dirname>default_server</dirname> parameter has been available since +The <literal>default_server</literal> parameter has been available since version 0.8.21. -In earlier versions the <dirname>default</dirname> parameter should be used +In earlier versions the <literal>default</literal> parameter should be used instead. </note> @@ -89,7 +89,7 @@ and a special nginx’s non-standard code 444 is returned that closes the connection. Since version 0.8.48, this is the default setting for the -server name, so the <code>server_name ""</code> can be omitted. +server name, so the <literal>server_name ""</literal> can be omitted. In earlier versions, the machine's <i>hostname</i> was used as a default server name. </para> @@ -125,10 +125,16 @@ </programlisting> In this configuration, nginx first tests the IP address and port -of the request against the <dirname>listen</dirname> directives -of the <dirname>server</dirname> blocks. It then tests the “Host” -header line of the request against the <dirname>server_name</dirname> -entries of the <dirname>server</dirname> blocks that matched +of the request against the +<link doc="ngx_http_core_module.xml" id="listen"/> directives +of the +<link doc="ngx_http_core_module.xml" id="server"/> blocks. +It then tests the “Host” +header line of the request against the +<link doc="ngx_http_core_module.xml" id="server_name"/> +entries of the +<link doc="ngx_http_core_module.xml" id="server"/> +blocks that matched the IP address and port. If the server name is not found, the request will be processed by @@ -201,7 +207,7 @@ <para> nginx first searches for the most specific location given by literal strings regardless of the listed order. In the configuration above -the only literal location is “<code>/</code>” and since it matches +the only literal location is “<literal>/</literal>” and since it matches any request it will be used as a last resort. Then nginx checks locations given by regular expression in the order listed in the configuration file. @@ -235,11 +241,11 @@ <item> <para> -A request “<code>/logo.gif</code>” is matched by the literal location -“<code>/</code>” first and then by the regular expression -“<code>\.(gif|jpg|png)$</code>”, +A request “<literal>/logo.gif</literal>” is matched by the literal location +“<literal>/</literal>” first and then by the regular expression +“<literal>\.(gif|jpg|png)$</literal>”, therefore, it is handled by the latter location. -Using the directive “<code>root /data/www</code>” the request +Using the directive “<literal>root /data/www</literal>” the request is mapped to a file <path>/data/www/logo.gif</path>, and the file is sent to the client. </para> @@ -247,25 +253,29 @@ <item> <para> -A request “<code>/index.php</code>” is also matched by the literal location -“<code>/</code>” first and then by the regular expression -“<code>\.(php)$</code>”. Therefore, it is handled by the latter location +A request “<literal>/index.php</literal>” is also matched by the literal location +“<literal>/</literal>” first and then by the regular expression +“<literal>\.(php)$</literal>”. Therefore, it is handled by the latter location and the request is passed to a FastCGI server listening on localhost:9000. -The <dirname>fastcgi_param</dirname> directive sets the FastCGI parameter -SCRIPT_FILENAME to “<code>/data/www/index.php</code>”, +The +<link doc="ngx_http_fastcgi_module.xml" id="fastcgi_param"/> +directive sets the FastCGI parameter +SCRIPT_FILENAME to “<literal>/data/www/index.php</literal>”, and the FastCGI server executes the file. The variable $document_root is equal to -the value of the <dirname>root</dirname> directive and +the value of the +<link doc="ngx_http_core_module.xml" id="root"/> +directive and the variable $fastcgi_script_name is equal to the request URI, -i.e. “<code>/index.php</code>”. +i.e. “<literal>/index.php</literal>”. </para> </item> <item> <para> -A request “<code>/about.html</code>” is matched by the literal location -“<code>/</code>” only, therefore, it is handled in this location. -Using the directive “<code>root /data/www</code>” the request is mapped +A request “<literal>/about.html</literal>” is matched by the literal location +“<literal>/</literal>” only, therefore, it is handled in this location. +Using the directive “<literal>root /data/www</literal>” the request is mapped to the file <path>/data/www/about.html</path>, and the file is sent to the client. </para> @@ -273,15 +283,18 @@ <item> <para> -Handling a request “<code>/</code>” is more complex. -It is matched by the literal location “<code>/</code>” only, +Handling a request “<literal>/</literal>” is more complex. +It is matched by the literal location “<literal>/</literal>” only, therefore, it is handled by this location. -Then the <dirname>index</dirname> directive tests for the existence +Then the +<link doc="ngx_http_index_module.xml" id="index"/> +directive tests for the existence of an index file according to its parameters and -the “<code>root /data/www</code>” directive. +the “<literal>root /data/www</literal>” directive. If a file <path>/data/www/index.php</path> exists, -then the directive does an internal redirect to “<code>/index.php</code>”, and -nginx searches the locations again as if the request had been sent by a client. +then the directive does an internal redirect to “<literal>/index.php</literal>”, +and nginx searches the locations again +as if the request had been sent by a client. As we saw before, the redirected request will eventually be handled by the FastCGI server. </para>