Skip to content

Commit 6d3c215

Browse files
committed
fixed terminology: it should be "internal redirect" instead of "internal jump".
1 parent 9b436c2 commit 6d3c215

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

en-uk/02-NginxDirectiveExecOrder06.tut

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,18 @@ in phase C<content>.
4747

4848
We have learnt in L<vartut/Nginx Variables (02)>, commands
4949
L<ngx_echo/echo_exec> and L<ngx_rewrite/rewrite> can trigger
50-
"internal jumps" as well. The jump modifies the request URI,
50+
"internal redirects" as well. The jump modifies the request URI,
5151
and looks for the corresponding C<location> directive for
5252
subsequent handling. In the process, phases C<rewrite>,
5353
C<access> and C<content> are reiterated for the C<location>.
54-
The "internal jump" is different from the "external redirect"
54+
The "internal redirect" is different from the "external redirect"
5555
defined by HTTP response code 302 and 301, client browser
5656
won't update its URI addresses. Therefore as soon as internal
5757
jump occurs when module L<ngx_index> finds the files specified
5858
by command L<ngx_index/index>, the net effect is like client
5959
would have been requesting the file's URI at the very beginning.
6060

61-
We can check following example to witness the "internal jump"
61+
We can check following example to witness the "internal redirect"
6262
triggered by module L<ngx_index>, when it finds the needed file.
6363

6464
:nginx
@@ -85,7 +85,7 @@ file F<index.html> (which shall be empty) ? Firstly Nginx uses
8585
directive C<location /> to handle original C<GET /> request, then
8686
module L<ngx_index> executes in C<content> phase, and it finds
8787
file F<index.html> under path F</var/www/>. At this moment, it
88-
triggers an "internal jump" to location C</index.html>.
88+
triggers an "internal redirect" to location C</index.html>.
8989

9090
So far so good. But here comes the surprises ! When Nginx
9191
looks for C<location> directive which matches to C</index.html>,
@@ -142,14 +142,14 @@ They are F<cgi-bin/>, F<error/>, F<htdocs/> and F<icons/>. The output
142142
might be different if you have tried by yourself.
143143

144144
Again, if file F</var/www/index.hmtl> does exist, module L<ngx_index>
145-
will trigger "internal jump", and module L<ngx_autoindex> will not have
145+
will trigger "internal redirect", and module L<ngx_autoindex> will not have
146146
a chance to execute, you may test it yourself too.
147147

148148
The "goal keeper" module executed in phase C<content> is L<ngx_static>.
149149
which is also used intensively. The module serves the static files, including
150150
the static resources of a web site, such as static F<.html> files, static
151151
F<.css> files, static F<.js> files and static image files etc. Although
152-
L<ngx_index> could trigger an "internal jump" to the specified home page,
152+
C<ngx_index> could trigger an "internal redirect" to the specified home page,
153153
but the actual output task (takes the file content as response, and marks
154154
the corresponding response headers) is carried out by module L<ngx_static>.
155155

en-uk/02-NginxDirectiveExecOrder09.tut

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ also executed in phase C<rewrite>.
5151
After C<rewrite>, it is the C<post-rewrite> phase. Just
5252
like C<find-config>, this phase does not allow Nginx modules
5353
to register their handlers either, instead it carries out
54-
the needed "internal jumps" by Nginx core (if this has been
54+
the needed "internal redirects" by Nginx core (if this has been
5555
requested in C<rewrite> phase). We have addressed the "internal
5656
jump" concept in L<vartut/(02)>, and demonstrated how to issue
57-
the "internal jump" with command L<ngx_echo/echo_exec> or
57+
the "internal redirect" with command L<ngx_echo/echo_exec> or
5858
command L<ngx_rewrite/rewrite>. However, let's focus on
5959
command L<ngx_rewrite/rewrite> for the moment since command
6060
L<ngx_echo/echo_exec> is executed in C<content> phase and
@@ -79,9 +79,9 @@ our example in L<vartut/(02)>:
7979
The command L<ngx_rewrite/rewrite> found in directive
8080
C<location /foo>, rewrites the URI of current request
8181
as C</bar> unconditionally, meanwhile, it issues an
82-
"internal jump" and execution continues from C<location /bar>.
82+
"internal redirect" and execution continues from C<location /bar>.
8383
What ultimately intrigues us, is the magical bits and pieces
84-
of "internal jump" mechanism, "internal jump" effectively
84+
of "internal redirect" mechanism, "internal redirect" effectively
8585
rewinds our processing of current request back to the
8686
C<find-config> phase, so that the C<location> directives
8787
can be matched again to the request URI, which usually
@@ -94,7 +94,7 @@ It might not be obvious, that the actual act of rewinding to
9494
C<find-config> does not occur in C<rewrite> phase, instead
9595
it occurs in the following C<post-rewrite> phase. Command
9696
L<ngx_rewrite/rewrite> in the former example, simply requests
97-
Nginx to issue an "internal jump" in its C<post-rewrite>
97+
Nginx to issue an "internal redirect" in its C<post-rewrite>
9898
phase. This design is usually questioned by Nginx beginners
9999
and they tend to come up with an idea to execute the "internal
100100
jump" directly by command L<ngx_rewrite/rewrite>. The answer
@@ -121,8 +121,8 @@ the very beginning. Such as:
121121
The request URI has been rewritten twice in C<location /foo>
122122
directive: firstly it becomes C</bar>, secondly it becomes
123123
C</baz>. As the net effect of both L<ngx_rewrite/rewrite>
124-
statements, "internal jump" occurs only once in C<post-rewrite>
125-
phase. If it would have executed the "internal jump" at
124+
statements, "internal redirect" occurs only once in C<post-rewrite>
125+
phase. If it would have executed the "internal redirect" at
126126
the first URI rewrite, the second would have no chance to be
127127
executed since processing would have left current C<location>
128128
directive. To prove this we send a request to C</foo>:
@@ -147,7 +147,7 @@ jump" occurs only once.
147147

148148
Quite obviously, if command C<ngx_rewrite/rewrite> is used
149149
to rewrite the request URI in C<server> directive, there won't
150-
be any "internal jumps", this is because the URI rewrite
150+
be any "internal redirects", this is because the URI rewrite
151151
is happening in C<server-rewrite> phase, which gets executed
152152
earlier than C<find-config> phase that matches in between
153153
the C<location> directives. We can check the example below:
@@ -188,4 +188,4 @@ Again let's check Nginx "debug log":
188188
[debug] 92693#0: *1 using configuration "/bar"
189189

190190
As we can tell, Nginx altogether finishes once the C<location>
191-
match, and there is no "internal jump".
191+
match, and there is no "internal redirect".

0 commit comments

Comments
 (0)