annotate xml/en/docs/http/ngx_http_perl_module.xml @ 2413:c6581f9aefa3

Documented Perl $r->internal_redirect() fixes.
author Yaroslav Zhuravlev <yar@nginx.com>
date Wed, 07 Aug 2019 21:04:14 +0300
parents c3f411040d24
children 23b9cbb0c11d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1 <?xml version="1.0"?>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
2
580
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 416
diff changeset
3 <!--
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 416
diff changeset
4 Copyright (C) Igor Sysoev
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 416
diff changeset
5 Copyright (C) Nginx, Inc.
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 416
diff changeset
6 -->
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 416
diff changeset
7
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
9
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
10 <module name="Module ngx_http_perl_module"
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
11 link="/en/docs/http/ngx_http_perl_module.html"
589
764fbac1b8b4 Added document revision.
Ruslan Ermilov <ru@nginx.com>
parents: 580
diff changeset
12 lang="en"
2413
c6581f9aefa3 Documented Perl $r->internal_redirect() fixes.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1718
diff changeset
13 rev="7">
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
14
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
15 <section id="summary">
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
16
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
17 <para>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
18 The <literal>ngx_http_perl_module</literal> module is used to implement
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
19 location and variable handlers in Perl and insert Perl calls into SSI.
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
20 </para>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
21
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
22 <para>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
23 This module is not built by default, it should be enabled with the
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
24 <literal>--with-http_perl_module</literal>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
25 configuration parameter.
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
26 <note>
1718
c3f411040d24 Added link to Perl in the perl module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1580
diff changeset
27 This module requires
c3f411040d24 Added link to Perl in the perl module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1580
diff changeset
28 <link url="https://www.perl.org/get.html">Perl</link> version 5.6.1 or higher.
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
29 The C compiler should be compatible with the one used to build Perl.
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
30 </note>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
31 </para>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
32
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
33 </section>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
34
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
35
1580
c711a8a1a8f9 Changed ID from "bugs" to "issues" for http/2, perl, spdy.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1578
diff changeset
36 <section id="issues" name="Known Issues">
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
37
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
38 <para>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
39 The module is experimental, caveat emptor applies.
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
40 </para>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
41
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
42 <para>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
43 In order for Perl to recompile the modified modules during
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
44 reconfiguration, it should be built with the
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
45 <literal>-Dusemultiplicity=yes</literal> or
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
46 <literal>-Dusethreads=yes</literal> parameters.
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
47 Also, to make Perl leak less memory at run time,
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
48 it should be built with the
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
49 <literal>-Dusemymalloc=no</literal> parameter.
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
50 To check the values of these parameters in an already built
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
51 Perl (preferred values are specified in the example), run:
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
52 <example>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
53 $ perl -V:usemultiplicity -V:usemymalloc
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
54 usemultiplicity='define';
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
55 usemymalloc='n';
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
56 </example>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
57 </para>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
58
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
59 <para>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
60 Note that after rebuilding Perl with the new
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
61 <literal>-Dusemultiplicity=yes</literal> or
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
62 <literal>-Dusethreads=yes</literal> parameters,
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
63 all binary Perl modules will have to be rebuilt as well —
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
64 they will just stop working with the new Perl.
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
65 </para>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
66
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
67 <para>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
68 There is a possibility that the main process and then worker processes will
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
69 grow in size after every reconfiguration.
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
70 If the main process grows to an unacceptable size, the
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
71 <link doc="../control.xml" id="upgrade">live upgrade</link>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
72 procedure can be applied without changing the executable file.
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
73 </para>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
74
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
75 <para>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
76 While the Perl module is performing a long-running operation, such as
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
77 resolving a domain name, connecting to another server, or querying a database,
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
78 other requests assigned to the current worker process will not be processed.
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
79 It is thus recommended to perform only such operations
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
80 that have predictable and short execution time, such as
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
81 accessing the local file system.
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
82 </para>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
83
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
84 </section>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
85
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
86
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
87 <section id="example" name="Example Configuration">
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
88
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
89 <para>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
90 <example>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
91 http {
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
92
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
93 perl_modules perl/lib;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
94 perl_require hello.pm;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
95
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
96 perl_set $msie6 '
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
97
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
98 sub {
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
99 my $r = shift;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
100 my $ua = $r->header_in("User-Agent");
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
101
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
102 return "" if $ua =~ /Opera/;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
103 return "1" if $ua =~ / MSIE [6-9]\.\d+/;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
104 return "";
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
105 }
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
106
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
107 ';
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
108
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
109 server {
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
110 location / {
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
111 perl hello::handler;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
112 }
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
113 }
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
114 </example>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
115 </para>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
116
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
117 <para>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
118 The <path>perl/lib/hello.pm</path> module:
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
119 <example>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
120 package hello;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
121
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
122 use nginx;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
123
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
124 sub handler {
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
125 my $r = shift;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
126
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
127 $r->send_http_header("text/html");
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
128 return OK if $r->header_only;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
129
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
130 $r->print("hello!\n&lt;br/&gt;");
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
131
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
132 if (-f $r->filename or -d _) {
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
133 $r->print($r->uri, " exists!\n");
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
134 }
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
135
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
136 return OK;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
137 }
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
138
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
139 1;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
140 __END__
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
141 </example>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
142 </para>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
143
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
144 </section>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
145
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
146
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
147 <section id="directives" name="Directives">
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
148
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
149 <directive name="perl">
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
150 <syntax><value>module</value>::<value>function</value>|'sub { ... }'</syntax>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
151 <default/>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
152 <context>location</context>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
153 <context>limit_except</context>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
154
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
155 <para>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
156 Sets a Perl handler for the given location.
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
157 </para>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
158
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
159 </directive>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
160
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
161
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
162 <directive name="perl_modules">
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
163 <syntax><value>path</value></syntax>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
164 <default/>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
165 <context>http</context>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
166
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
167 <para>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
168 Sets an additional path for Perl modules.
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
169 </para>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
170
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
171 </directive>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
172
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
173
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
174 <directive name="perl_require">
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
175 <syntax><value>module</value></syntax>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
176 <default/>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
177 <context>http</context>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
178
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
179 <para>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
180 Defines the name of a module that will be loaded during each
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
181 reconfiguration.
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
182 Several <literal>perl_require</literal> directives can be present.
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
183 </para>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
184
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
185 </directive>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
186
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
187
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
188 <directive name="perl_set">
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
189 <syntax>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
190 <value>$variable</value>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
191 <value>module</value>::<value>function</value>|'sub { ... }'</syntax>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
192 <default/>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
193 <context>http</context>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
194
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
195 <para>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
196 Installs a Perl handler for the specified variable.
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
197 </para>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
198
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
199 </directive>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
200
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
201 </section>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
202
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
203
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
204 <section id="ssi" name="Calling Perl from SSI">
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
205
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
206 <para>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
207 An SSI command calling Perl has the following format:
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
208 <example>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
209 &lt;!--# perl sub="<value>module</value>::<value>function</value>" arg="<value>parameter1</value>" arg="<value>parameter2</value>" ...
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
210 --&gt;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
211 </example>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
212 </para>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
213
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
214 </section>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
215
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
216
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
217 <section id="methods" name="The $r Request Object Methods">
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
218
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
219 <para>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
220 <list type="tag">
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
221
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
222 <tag-name><literal>$r->args</literal></tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
223 <tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
224 returns request arguments.
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
225 </tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
226
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
227 <tag-name><literal>$r->filename</literal></tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
228 <tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
229 returns a filename corresponding to the request URI.
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
230 </tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
231
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
232 <tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
233 <literal>$r->has_request_body(<value>handler</value>)</literal>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
234 </tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
235 <tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
236 returns 0 if there is no body in a request.
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
237 If there is a body, the specified handler is set for the request
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
238 and 1 is returned.
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
239 After reading the request body, nginx will call the specified handler.
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
240 Note that the handler function should be passed by reference.
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
241 Example:
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
242 <example>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
243 package hello;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
244
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
245 use nginx;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
246
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
247 sub handler {
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
248 my $r = shift;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
249
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
250 if ($r->request_method ne "POST") {
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
251 return DECLINED;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
252 }
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
253
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
254 if ($r->has_request_body(<emphasis>\&amp;post</emphasis>)) {
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
255 return OK;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
256 }
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
257
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
258 return HTTP_BAD_REQUEST;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
259 }
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
260
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
261 sub <emphasis>post</emphasis> {
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
262 my $r = shift;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
263
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
264 $r->send_http_header;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
265
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
266 $r->print("request_body: \"", $r->request_body, "\"&lt;br/&gt;");
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
267 $r->print("request_body_file: \"", $r->request_body_file, "\"&lt;br/&gt;\n");
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
268
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
269 return OK;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
270 }
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
271
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
272 1;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
273
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
274 __END__
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
275 </example>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
276 </tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
277
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
278 <tag-name><literal>$r->allow_ranges</literal></tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
279 <tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
280 enables the use of byte ranges when sending responses.
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
281 </tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
282
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
283 <tag-name><literal>$r->discard_request_body</literal></tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
284 <tag-desc>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
285 instructs nginx to discard the request body.
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
286 </tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
287
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
288 <tag-name><literal>$r->header_in(<value>field</value>)</literal></tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
289 <tag-desc>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
290 returns the value of the specified client request header field.
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
291 </tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
292
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
293 <tag-name><literal>$r->header_only</literal></tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
294 <tag-desc>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
295 determines whether the whole response or only its header should be sent to
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
296 the client.
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
297 </tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
298
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
299 <tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
300 <literal>$r->header_out(<value>field</value>,
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
301 <value>value</value>)</literal>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
302 </tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
303 <tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
304 sets a value for the specified response header field.
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
305 </tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
306
2413
c6581f9aefa3 Documented Perl $r->internal_redirect() fixes.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1718
diff changeset
307 <tag-name id="r_internal_redirect">
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
308 <literal>$r->internal_redirect(<value>uri</value>)</literal>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
309 </tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
310 <tag-desc>
747
ddec437b692b Fixed a number of typos.
Vladimir Homutov <vl@nginx.com>
parents: 589
diff changeset
311 does an internal redirect to the specified <value>uri</value>.
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
312 An actual redirect happens after the Perl handler execution is completed.
760
f0e3d07c66d8 Documented $r->log_error method, redirection limitation, removed outdated info.
Vladimir Homutov <vl@nginx.com>
parents: 747
diff changeset
313 <note>
2413
c6581f9aefa3 Documented Perl $r->internal_redirect() fixes.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1718
diff changeset
314 Since version 1.17.2, the method accepts escaped URIs and
c6581f9aefa3 Documented Perl $r->internal_redirect() fixes.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1718
diff changeset
315 supports redirections to named locations.
760
f0e3d07c66d8 Documented $r->log_error method, redirection limitation, removed outdated info.
Vladimir Homutov <vl@nginx.com>
parents: 747
diff changeset
316 </note>
f0e3d07c66d8 Documented $r->log_error method, redirection limitation, removed outdated info.
Vladimir Homutov <vl@nginx.com>
parents: 747
diff changeset
317 </tag-desc>
f0e3d07c66d8 Documented $r->log_error method, redirection limitation, removed outdated info.
Vladimir Homutov <vl@nginx.com>
parents: 747
diff changeset
318
f0e3d07c66d8 Documented $r->log_error method, redirection limitation, removed outdated info.
Vladimir Homutov <vl@nginx.com>
parents: 747
diff changeset
319 <tag-name><literal>$r->log_error(<value>errno</value>,
f0e3d07c66d8 Documented $r->log_error method, redirection limitation, removed outdated info.
Vladimir Homutov <vl@nginx.com>
parents: 747
diff changeset
320 <value>message</value>)</literal></tag-name>
f0e3d07c66d8 Documented $r->log_error method, redirection limitation, removed outdated info.
Vladimir Homutov <vl@nginx.com>
parents: 747
diff changeset
321 <tag-desc>
f0e3d07c66d8 Documented $r->log_error method, redirection limitation, removed outdated info.
Vladimir Homutov <vl@nginx.com>
parents: 747
diff changeset
322 writes the specified <value>message</value> into the
f0e3d07c66d8 Documented $r->log_error method, redirection limitation, removed outdated info.
Vladimir Homutov <vl@nginx.com>
parents: 747
diff changeset
323 <link doc="../ngx_core_module.xml" id="error_log"/>.
f0e3d07c66d8 Documented $r->log_error method, redirection limitation, removed outdated info.
Vladimir Homutov <vl@nginx.com>
parents: 747
diff changeset
324 If <value>errno</value> is non-zero, an error code and its description
f0e3d07c66d8 Documented $r->log_error method, redirection limitation, removed outdated info.
Vladimir Homutov <vl@nginx.com>
parents: 747
diff changeset
325 will be appended to the message.
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
326 </tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
327
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
328 <tag-name><literal>$r->print(<value>text</value>, ...)</literal></tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
329 <tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
330 passes data to a client.
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
331 </tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
332
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
333 <tag-name><literal>$r->request_body</literal></tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
334 <tag-desc>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
335 returns the client request body if it has not been
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
336 written to a temporary file.
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
337 To ensure that the client request body is in memory,
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
338 its size should be limited by
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
339 <link doc="ngx_http_core_module.xml" id="client_max_body_size"/>,
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
340 and a sufficient buffer size should be set using
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
341 <link doc="ngx_http_core_module.xml" id="client_body_buffer_size"/>.
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
342 </tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
343
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
344 <tag-name><literal>$r->request_body_file</literal></tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
345 <tag-desc>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
346 returns the name of the file with the client request body.
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
347 After the processing, the file should be removed.
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
348 To always write a request body to a file,
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
349 <link doc="ngx_http_core_module.xml" id="client_body_in_file_only"/>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
350 should be enabled.
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
351 </tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
352
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
353 <tag-name><literal>$r->request_method</literal></tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
354 <tag-desc>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
355 returns the client request HTTP method.
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
356 </tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
357
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
358 <tag-name><literal>$r->remote_addr</literal></tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
359 <tag-desc>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
360 returns the client IP address.
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
361 </tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
362
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
363 <tag-name><literal>$r->flush</literal></tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
364 <tag-desc>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
365 immediately sends data to the client.
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
366 </tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
367
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
368 <tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
369 <literal>$r->sendfile(<value>name</value>[,
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
370 <value>offset</value>[,
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
371 <value>length</value>]])</literal>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
372 </tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
373 <tag-desc>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
374 sends the specified file content to the client.
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
375 Optional parameters
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
376 specify the initial offset and length of the data to be transmitted.
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
377 The actual data transmission happens after the Perl handler
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
378 has completed.
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
379 </tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
380
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
381 <tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
382 <literal>$r->send_http_header([<value>type</value>])</literal>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
383 </tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
384 <tag-desc>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
385 sends the response header to the client.
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
386 The optional <value>type</value> parameter sets the value of
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
387 the <header>Content-Type</header> response header field.
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
388 If the value is an empty string, the <header>Content-Type</header>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
389 header field will not be sent.
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
390 </tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
391
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
392 <tag-name><literal>$r->status(<value>code</value>)</literal></tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
393 <tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
394 sets a response code.
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
395 </tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
396
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
397 <tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
398 <literal>$r->sleep(<value>milliseconds</value>,
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
399 <value>handler</value>)</literal>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
400 </tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
401 <tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
402 sets the specified handler
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
403 and stops request processing for the specified time.
1146
d37892ad69ab Corrected spelling in the "in the meantime" phrase.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 966
diff changeset
404 In the meantime, nginx continues to process other requests.
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
405 After the specified time has elapsed, nginx will call the installed handler.
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
406 Note that the handler function should be passed by reference.
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
407 In order to pass data between handlers,
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
408 <literal>$r->variable()</literal> should be used.
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
409 Example:
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
410 <example>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
411 package hello;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
412
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
413 use nginx;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
414
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
415 sub handler {
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
416 my $r = shift;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
417
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
418 $r->discard_request_body;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
419 $r->variable("var", "OK");
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
420 $r->sleep(1000, <emphasis>\&amp;next</emphasis>);
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
421
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
422 return OK;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
423 }
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
424
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
425 sub <emphasis>next</emphasis> {
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
426 my $r = shift;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
427
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
428 $r->send_http_header;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
429 $r->print($r->variable("var"));
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
430
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
431 return OK;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
432 }
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
433
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
434 1;
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
435
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
436 __END__
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
437 </example>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
438 </tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
439
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
440 <tag-name><literal>$r->unescape(<value>text</value>)</literal></tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
441 <tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
442 decodes a text encoded in the “%XX” form.
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
443 </tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
444
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
445 <tag-name><literal>$r->uri</literal></tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
446 <tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
447 returns a request URI.
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
448 </tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
449
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
450 <tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
451 <literal>$r->variable(<value>name</value>[,
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
452 <value>value</value>])</literal>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
453 </tag-name>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
454 <tag-desc>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 760
diff changeset
455 returns or sets the value of the specified variable.
416
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
456 Variables are local to each request.
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
457 </tag-desc>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
458
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
459 </list>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
460 </para>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
461
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
462 </section>
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
463
c9c0550465c9 English translation of ngx_http_perl_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
464 </module>