]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_proxy_scgi.html.en
xforms
[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         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5               This file is generated from xml source: DO NOT EDIT
6         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7       -->
8 <title>mod_proxy_scgi - Apache HTTP Server</title>
9 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11 <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" />
12 <script src="../style/scripts/prettify.js" type="text/javascript">
13 </script>
14
15 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
16 <body>
17 <div id="page-header">
18 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.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>
19 <p class="apache">Apache HTTP Server Version 2.5</p>
20 <img alt="" src="../images/feather.gif" /></div>
21 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
22 <div id="path">
23 <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>
24 <div id="page-content">
25 <div id="preamble"><h1>Apache Module mod_proxy_scgi</h1>
26 <div class="toplang">
27 <p><span>Available Languages: </span><a href="../en/mod/mod_proxy_scgi.html" title="English">&nbsp;en&nbsp;</a></p>
28 </div>
29 <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>
30 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
31 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>proxy_scgi_module</td></tr>
32 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_proxy_scgi.c</td></tr>
33 <tr><th><a href="module-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.2.14 and later</td></tr></table>
34 <h3>Summary</h3>
35
36     <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
37     <a href="http://python.ca/scgi/protocol.txt">SCGI protocol, version
38     1</a>.</p>
39
40     <p>Thus, in order to get the ability of handling the SCGI protocol,
41     <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
42     be present in the server.</p>
43
44     <div class="warning"><h3>Warning</h3>
45       <p>Do not enable proxying until you have <a href="mod_proxy.html#access">secured your server</a>. Open proxy
46       servers are dangerous both to your network and to the Internet at
47       large.</p>
48     </div>
49 </div>
50 <div id="quickview"><h3 class="directives">Directives</h3>
51 <ul id="toc">
52 <li><img alt="" src="../images/down.gif" /> <a href="#proxyscgiinternalredirect">ProxySCGIInternalRedirect</a></li>
53 <li><img alt="" src="../images/down.gif" /> <a href="#proxyscgisendfile">ProxySCGISendfile</a></li>
54 </ul>
55 <h3>Topics</h3>
56 <ul id="topics">
57 <li><img alt="" src="../images/down.gif" /> <a href="#examples">Examples</a></li>
58 <li><img alt="" src="../images/down.gif" /> <a href="#env">Environment Variables</a></li>
59 </ul><h3>See also</h3>
60 <ul class="seealso">
61 <li><code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code></li>
62 <li><code class="module"><a href="../mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code></li>
63 </ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
64 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
65 <div class="section">
66 <h2><a name="examples" id="examples">Examples</a></h2>
67     <p>Remember, in order to make the following examples work, you have to
68     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>
69
70     <div class="example"><h3>Simple gateway</h3><pre class="prettyprint lang-config">
71       ProxyPass /scgi-bin/ scgi://localhost:4000/
72       </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">
82 ProxyPass /scgi-bin/ balancer://somecluster/
83 &lt;Proxy balancer://somecluster/&gt;
84     BalancerMember scgi://localhost:4000/
85     BalancerMember scgi://localhost:4001/
86 &lt;/Proxy&gt;
87     </pre>
88 </div>
89 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
90 <div class="section">
91 <h2><a name="env" id="env">Environment Variables</a></h2>
92     <p>In addition to the configuration directives that control the
93     behaviour of <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code>, there are a number of
94     <dfn>environment variables</dfn> that control the SCGI protocol
95     provider:</p>
96     <dl>
97         <dt>proxy-scgi-pathinfo</dt>
98         <dd>By default <code class="module"><a href="../mod/mod_proxy_scgi.html">mod_proxy_scgi</a></code> will neither create
99         nor export the <var>PATH_INFO</var> environment variable. This allows
100         the backend SCGI server to correctly determine <var>SCRIPT_NAME</var>
101         and <var>Script-URI</var> and be compliant with RFC 3875 section 3.3.
102         If instead you need <code class="module"><a href="../mod/mod_proxy_scgi.html">mod_proxy_scgi</a></code> to generate
103         a "best guess" for <var>PATH_INFO</var>, set this env-var.</dd>
104     </dl>
105 </div>
106 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
107 <div class="directive-section"><h2><a name="ProxySCGIInternalRedirect" id="ProxySCGIInternalRedirect">ProxySCGIInternalRedirect</a> <a name="proxyscgiinternalredirect" id="proxyscgiinternalredirect">Directive</a></h2>
108 <table class="directive">
109 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable or disable internal redirect responses from the
110 backend</td></tr>
111 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxySCGIInternalRedirect On|Off</code></td></tr>
112 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxySCGIInternalRedirect On</code></td></tr>
113 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
114 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
115 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_scgi</td></tr>
116 </table>
117     <p>The <code class="directive">ProxySCGIInternalRedirect</code> enables the backend
118     to internally redirect the gateway to a different URL. This feature
119     origins in <code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code>, which internally redirects the
120     response, if the response status is <code>OK</code> (<code>200</code>) and
121     the response contains a <code>Location</code> header and its value starts
122     with a slash (<code>/</code>). This value is interpreted as a new local
123     URL the apache internally redirects to.</p>
124
125     <p><code class="module"><a href="../mod/mod_proxy_scgi.html">mod_proxy_scgi</a></code> does the same as
126     <code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code> in this regard, except that you can turn off the
127     feature.</p>
128
129     <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">
130     ProxySCGIInternalRedirect Off
131     </pre>
132 </div>
133
134 </div>
135 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
136 <div class="directive-section"><h2><a name="ProxySCGISendfile" id="ProxySCGISendfile">ProxySCGISendfile</a> <a name="proxyscgisendfile" id="proxyscgisendfile">Directive</a></h2>
137 <table class="directive">
138 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable evaluation of <var>X-Sendfile</var> pseudo response
139 header</td></tr>
140 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxySCGISendfile On|Off|<var>Headername</var></code></td></tr>
141 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxySCGISendfile Off</code></td></tr>
142 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
143 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
144 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_scgi</td></tr>
145 </table>
146     <p>The <code class="directive">ProxySCGISendfile</code> directive enables the
147     SCGI backend to let files serve directly by the gateway. This is useful
148     performance purposes -- the httpd can use <code>sendfile</code> or other
149     optimizations, which are not possible if the file comes over the backend
150     socket.</p>
151     <p>The <code class="directive">ProxySCGISendfile</code> argument determines the
152     gateway behaviour:</p>
153     <dl>
154     <dt><code>Off</code></dt>
155     <dd>No special handling takes place.</dd>
156
157     <dt><code>On</code></dt>
158     <dd>The gateway looks for a backend response header called
159     <code>X-Sendfile</code> and interprets the value as filename to serve. The
160     header is removed from the final response headers. This is equivalent to
161     <code>ProxySCGISendfile X-Sendfile</code>.</dd>
162
163     <dt>anything else</dt>
164     <dd>Similar to <code>On</code>, but instead of the hardcoded header name
165     the argument is applied as header name.</dd>
166     </dl>
167
168     <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">
169     # Use the default header (X-Sendfile)
170     ProxySCGISendfile On
171     
172     # Use a different header
173     ProxySCGISendfile X-Send-Static
174     </pre>
175 </div>
176
177 </div>
178 </div>
179 <div class="bottomlang">
180 <p><span>Available Languages: </span><a href="../en/mod/mod_proxy_scgi.html" title="English">&nbsp;en&nbsp;</a></p>
181 </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>
182 <script type="text/javascript"><!--//--><![CDATA[//><!--
183 var comments_shortname = 'httpd';
184 var comments_identifier = 'http://httpd.apache.org/docs/trunk/mod/mod_proxy_scgi.html';
185 (function(w, d) {
186     if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
187         d.write('<div id="comments_thread"><\/div>');
188         var s = d.createElement('script');
189         s.type = 'text/javascript';
190         s.async = true;
191         s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
192         (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
193     }
194     else {
195         d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
196     }
197 })(window, document);
198 //--><!]]></script></div><div id="footer">
199 <p class="apache">Copyright 2012 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>
200 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.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[//><!--
201 if (typeof(prettyPrint) !== 'undefined') {
202     prettyPrint();
203 }
204 //--><!]]></script>
205 </body></html>