]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_proxy_scgi.html.en
move es and fr targets to *.utf8 extension. Update transformation
[apache] / docs / manual / mod / mod_proxy_scgi.html.en
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
4 <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
5 <!--
6         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7               This file is generated from xml source: DO NOT EDIT
8         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
9       -->
10 <title>mod_proxy_scgi - Apache HTTP Server Version 2.5</title>
11 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
12 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
13 <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" />
14 <script src="../style/scripts/prettify.min.js" type="text/javascript">
15 </script>
16
17 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
18 <body>
19 <div id="page-header">
20 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
21 <p class="apache">Apache HTTP Server Version 2.5</p>
22 <img alt="" src="../images/feather.png" /></div>
23 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
24 <div id="path">
25 <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.5</a> &gt; <a href="./">Modules</a></div>
26 <div id="page-content">
27 <div id="preamble"><h1>Apache Module mod_proxy_scgi</h1>
28 <div class="toplang">
29 <p><span>Available Languages: </span><a href="../en/mod/mod_proxy_scgi.html" title="English">&nbsp;en&nbsp;</a> |
30 <a href="../fr/mod/mod_proxy_scgi.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a></p>
31 </div>
32 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>SCGI gateway module for <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code></td></tr>
33 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
34 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>proxy_scgi_module</td></tr>
35 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_proxy_scgi.c</td></tr></table>
36 <h3>Summary</h3>
37
38     <p>This module <em>requires</em> the service of <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code>. It provides support for the
39     <a href="http://python.ca/scgi/protocol.txt">SCGI protocol, version
40     1</a>.</p>
41
42     <p>Thus, in order to get the ability of handling the SCGI protocol,
43     <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> and <code class="module"><a href="../mod/mod_proxy_scgi.html">mod_proxy_scgi</a></code> have to
44     be present in the server.</p>
45
46     <div class="warning"><h3>Warning</h3>
47       <p>Do not enable proxying until you have <a href="mod_proxy.html#access">secured your server</a>. Open proxy
48       servers are dangerous both to your network and to the Internet at
49       large.</p>
50     </div>
51 </div>
52 <div id="quickview"><h3>Topics</h3>
53 <ul id="topics">
54 <li><img alt="" src="../images/down.gif" /> <a href="#examples">Examples</a></li>
55 <li><img alt="" src="../images/down.gif" /> <a href="#env">Environment Variables</a></li>
56 </ul><h3 class="directives">Directives</h3>
57 <ul id="toc">
58 <li><img alt="" src="../images/down.gif" /> <a href="#proxyscgiinternalredirect">ProxySCGIInternalRedirect</a></li>
59 <li><img alt="" src="../images/down.gif" /> <a href="#proxyscgisendfile">ProxySCGISendfile</a></li>
60 </ul>
61 <h3>Bugfix checklist</h3><ul class="seealso"><li><a href="https://www.apache.org/dist/httpd/CHANGES_2.4">httpd changelog</a></li><li><a href="https://bz.apache.org/bugzilla/buglist.cgi?bug_status=__open__&amp;list_id=144532&amp;product=Apache%20httpd-2&amp;query_format=specific&amp;order=changeddate%20DESC%2Cpriority%2Cbug_severity&amp;component=mod_proxy_scgi">Known issues</a></li><li><a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2&amp;component=mod_proxy_scgi">Report a bug</a></li></ul><h3>See also</h3>
62 <ul class="seealso">
63 <li><code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code></li>
64 <li><code class="module"><a href="../mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code></li>
65 <li><a href="#comments_section">Comments</a></li></ul></div>
66 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
67 <div class="section">
68 <h2><a name="examples" id="examples">Examples</a><a title="Permanent link" href="#examples" class="permalink">&para;</a></h2>
69     <p>Remember, in order to make the following examples work, you have to
70     enable <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> and <code class="module"><a href="../mod/mod_proxy_scgi.html">mod_proxy_scgi</a></code>.</p>
71
72     <div class="example"><h3>Simple gateway</h3><pre class="prettyprint lang-config">ProxyPass "/scgi-bin/" "scgi://localhost:4000/"</pre>
73 </div>
74
75     <p>The balanced gateway needs <code class="module"><a href="../mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code> and
76     at least one load balancer algorithm module, such as
77     <code class="module"><a href="../mod/mod_lbmethod_byrequests.html">mod_lbmethod_byrequests</a></code>, in addition to the proxy
78     modules listed above.  <code class="module"><a href="../mod/mod_lbmethod_byrequests.html">mod_lbmethod_byrequests</a></code> is the
79     default, and will be used for this example configuration.</p>
80
81     <div class="example"><h3>Balanced gateway</h3><pre class="prettyprint lang-config">ProxyPass "/scgi-bin/" "balancer://somecluster/"
82 &lt;Proxy balancer://somecluster&gt;
83     BalancerMember scgi://localhost:4000
84     BalancerMember scgi://localhost:4001
85 &lt;/Proxy&gt;</pre>
86 </div>
87 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
88 <div class="section">
89 <h2><a name="env" id="env">Environment Variables</a><a title="Permanent link" href="#env" class="permalink">&para;</a></h2>
90     <p>In addition to the configuration directives that control the
91     behaviour of <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code>, an <dfn>environment
92     variable</dfn> may also control the SCGI protocol
93     provider:</p>
94     <dl>
95         <dt>proxy-scgi-pathinfo</dt>
96         <dd>By default <code class="module"><a href="../mod/mod_proxy_scgi.html">mod_proxy_scgi</a></code> will neither create
97         nor export the <var>PATH_INFO</var> environment variable. This allows
98         the backend SCGI server to correctly determine <var>SCRIPT_NAME</var>
99         and <var>Script-URI</var> and be compliant with RFC 3875 section 3.3.
100         If instead you need <code class="module"><a href="../mod/mod_proxy_scgi.html">mod_proxy_scgi</a></code> to generate
101         a "best guess" for <var>PATH_INFO</var>, set this env-var.  The
102         variable must be set before <code class="directive"><a href="../mod/mod_env.html#setenv">SetEnv</a></code>
103         is effective.  <code class="directive"><a href="../mod/mod_setenvif.html#setenvif">SetEnvIf</a></code> can be
104         used instead: <code>SetEnvIf Request_URI . proxy-scgi-pathinfo</code>
105         </dd>
106     </dl>
107 </div>
108 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
109 <div class="directive-section"><h2><a name="ProxySCGIInternalRedirect" id="ProxySCGIInternalRedirect">ProxySCGIInternalRedirect</a> <a name="proxyscgiinternalredirect" id="proxyscgiinternalredirect">Directive</a><a title="Permanent link" href="#proxyscgiinternalredirect" class="permalink">&para;</a></h2>
110 <table class="directive">
111 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable or disable internal redirect responses from the
112 backend</td></tr>
113 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxySCGIInternalRedirect On|Off|<var>Headername</var></code></td></tr>
114 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxySCGIInternalRedirect On</code></td></tr>
115 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
116 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
117 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_scgi</td></tr>
118 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>The <var>Headername</var> feature is available in Apache
119 httpd 2.4.13 and later.</td></tr>
120 </table>
121     <p>The <code class="directive">ProxySCGIInternalRedirect</code> enables the backend
122     to internally redirect the gateway to a different URL. This feature
123     originates in <code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code>, which internally redirects the
124     response if the response status is <code>OK</code> (<code>200</code>) and
125     the response contains a <code>Location</code> (or configured alternate
126     header) and its value starts with a slash (<code>/</code>). This value is 
127     interpreted as a new local URL that Apache httpd internally redirects to.</p>
128
129     <p><code class="module"><a href="../mod/mod_proxy_scgi.html">mod_proxy_scgi</a></code> does the same as
130     <code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code> in this regard, except that you can turn off the
131     feature or specify the use of a header other than <code>Location</code>.</p>
132
133     <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">    ProxySCGIInternalRedirect Off
134
135 # Django and some other frameworks will fully qualify "local URLs"
136 # set by the application, so an alternate header must be used.
137 &lt;Location /django-app/&gt;
138     ProxySCGIInternalRedirect X-Location
139 &lt;/Location&gt;</pre>
140 </div>
141
142 </div>
143 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
144 <div class="directive-section"><h2><a name="ProxySCGISendfile" id="ProxySCGISendfile">ProxySCGISendfile</a> <a name="proxyscgisendfile" id="proxyscgisendfile">Directive</a><a title="Permanent link" href="#proxyscgisendfile" class="permalink">&para;</a></h2>
145 <table class="directive">
146 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable evaluation of <var>X-Sendfile</var> pseudo response
147 header</td></tr>
148 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxySCGISendfile On|Off|<var>Headername</var></code></td></tr>
149 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxySCGISendfile Off</code></td></tr>
150 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
151 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
152 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_scgi</td></tr>
153 </table>
154     <p>The <code class="directive">ProxySCGISendfile</code> directive enables the
155     SCGI backend to let files be served directly by the gateway. This is useful
156     for performance purposes &#8212; httpd can use <code>sendfile</code> or other
157     optimizations, which are not possible if the file comes over the backend
158     socket.  Additionally, the file contents are not transmitted twice.</p>
159     <p>The <code class="directive">ProxySCGISendfile</code> argument determines the
160     gateway behaviour:</p>
161     <dl>
162     <dt><code>Off</code></dt>
163     <dd>No special handling takes place.</dd>
164
165     <dt><code>On</code></dt>
166     <dd>The gateway looks for a backend response header called
167     <code>X-Sendfile</code> and interprets the value as the filename to serve.
168     The  header is removed from the final response headers. This is equivalent to
169     <code>ProxySCGISendfile X-Sendfile</code>.</dd>
170
171     <dt>anything else</dt>
172     <dd>Similar to <code>On</code>, but instead of the hardcoded header name
173     <code>X-Sendfile</code>, the argument is used as the header name.</dd>
174     </dl>
175
176     <div class="example"><h3>Example</h3><pre class="prettyprint lang-config"># Use the default header (X-Sendfile)
177 ProxySCGISendfile On
178
179 # Use a different header
180 ProxySCGISendfile X-Send-Static</pre>
181 </div>
182
183 </div>
184 </div>
185 <div class="bottomlang">
186 <p><span>Available Languages: </span><a href="../en/mod/mod_proxy_scgi.html" title="English">&nbsp;en&nbsp;</a> |
187 <a href="../fr/mod/mod_proxy_scgi.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a></p>
188 </div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
189 <script type="text/javascript"><!--//--><![CDATA[//><!--
190 var comments_shortname = 'httpd';
191 var comments_identifier = 'http://httpd.apache.org/docs/trunk/mod/mod_proxy_scgi.html';
192 (function(w, d) {
193     if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
194         d.write('<div id="comments_thread"><\/div>');
195         var s = d.createElement('script');
196         s.type = 'text/javascript';
197         s.async = true;
198         s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
199         (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
200     }
201     else {
202         d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
203     }
204 })(window, document);
205 //--><!]]></script></div><div id="footer">
206 <p class="apache">Copyright 2018 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
207 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
208 if (typeof(prettyPrint) !== 'undefined') {
209     prettyPrint();
210 }
211 //--><!]]></script>
212 </body></html>