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
8 <title>mod_proxy_scgi - Apache HTTP Server Version 2.5</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.min.js" type="text/javascript">
15 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
17 <div id="page-header">
18 <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>
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="<-" alt="<-" src="../images/left.gif" /></a></div>
23 <a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.5</a> > <a href="./">Modules</a></div>
24 <div id="page-content">
25 <div id="preamble"><h1>Apache Module mod_proxy_scgi</h1>
27 <p><span>Available Languages: </span><a href="../en/mod/mod_proxy_scgi.html" title="English"> en </a></p>
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></table>
35 <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
36 <a href="http://python.ca/scgi/protocol.txt">SCGI protocol, version
39 <p>Thus, in order to get the ability of handling the SCGI protocol,
40 <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
41 be present in the server.</p>
43 <div class="warning"><h3>Warning</h3>
44 <p>Do not enable proxying until you have <a href="mod_proxy.html#access">secured your server</a>. Open proxy
45 servers are dangerous both to your network and to the Internet at
49 <div id="quickview"><h3>Topics</h3>
51 <li><img alt="" src="../images/down.gif" /> <a href="#examples">Examples</a></li>
52 <li><img alt="" src="../images/down.gif" /> <a href="#env">Environment Variables</a></li>
53 </ul><h3 class="directives">Directives</h3>
55 <li><img alt="" src="../images/down.gif" /> <a href="#proxyscgiinternalredirect">ProxySCGIInternalRedirect</a></li>
56 <li><img alt="" src="../images/down.gif" /> <a href="#proxyscgisendfile">ProxySCGISendfile</a></li>
60 <li><code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code></li>
61 <li><code class="module"><a href="../mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code></li>
62 </ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
63 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
65 <h2><a name="examples" id="examples">Examples</a></h2>
66 <p>Remember, in order to make the following examples work, you have to
67 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 <div class="example"><h3>Simple gateway</h3><pre class="prettyprint lang-config">ProxyPass /scgi-bin/ scgi://localhost:4000/</pre>
72 <p>The balanced gateway needs <code class="module"><a href="../mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code> and
73 at least one load balancer algorithm module, such as
74 <code class="module"><a href="../mod/mod_lbmethod_byrequests.html">mod_lbmethod_byrequests</a></code>, in addition to the proxy
75 modules listed above. <code class="module"><a href="../mod/mod_lbmethod_byrequests.html">mod_lbmethod_byrequests</a></code> is the
76 default, and will be used for this example configuration.</p>
78 <div class="example"><h3>Balanced gateway</h3><pre class="prettyprint lang-config">ProxyPass /scgi-bin/ balancer://somecluster/
79 <Proxy balancer://somecluster>
80 BalancerMember scgi://localhost:4000
81 BalancerMember scgi://localhost:4001
84 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
86 <h2><a name="env" id="env">Environment Variables</a></h2>
87 <p>In addition to the configuration directives that control the
88 behaviour of <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code>, an <dfn>environment
89 variable</dfn> may also control the SCGI protocol
92 <dt>proxy-scgi-pathinfo</dt>
93 <dd>By default <code class="module"><a href="../mod/mod_proxy_scgi.html">mod_proxy_scgi</a></code> will neither create
94 nor export the <var>PATH_INFO</var> environment variable. This allows
95 the backend SCGI server to correctly determine <var>SCRIPT_NAME</var>
96 and <var>Script-URI</var> and be compliant with RFC 3875 section 3.3.
97 If instead you need <code class="module"><a href="../mod/mod_proxy_scgi.html">mod_proxy_scgi</a></code> to generate
98 a "best guess" for <var>PATH_INFO</var>, set this env-var. The
99 variable must be set before <code class="directive"><a href="../mod/env.html#setenv">SetEnv</a></code>
100 is effective. <code class="directive"><a href="../mod/setenv.html#setenvif">SetEnvIf</a></code> can be
101 used instead: <code>SetEnvIf Request_URI . proxy-scgi-pathinfo</code>
105 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
106 <div class="directive-section"><h2><a name="ProxySCGIInternalRedirect" id="ProxySCGIInternalRedirect">ProxySCGIInternalRedirect</a> <a name="proxyscgiinternalredirect" id="proxyscgiinternalredirect">Directive</a></h2>
107 <table class="directive">
108 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable or disable internal redirect responses from the
110 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxySCGIInternalRedirect On|Off</code></td></tr>
111 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxySCGIInternalRedirect On</code></td></tr>
112 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
113 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
114 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_scgi</td></tr>
116 <p>The <code class="directive">ProxySCGIInternalRedirect</code> enables the backend
117 to internally redirect the gateway to a different URL. This feature
118 originates in <code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code>, which internally redirects the
119 response if the response status is <code>OK</code> (<code>200</code>) and
120 the response contains a <code>Location</code> header and its value starts
121 with a slash (<code>/</code>). This value is interpreted as a new local
122 URL that Apache httpd internally redirects to.</p>
124 <p><code class="module"><a href="../mod/mod_proxy_scgi.html">mod_proxy_scgi</a></code> does the same as
125 <code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code> in this regard, except that you can turn off the
128 <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">ProxySCGIInternalRedirect Off</pre>
132 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
133 <div class="directive-section"><h2><a name="ProxySCGISendfile" id="ProxySCGISendfile">ProxySCGISendfile</a> <a name="proxyscgisendfile" id="proxyscgisendfile">Directive</a></h2>
134 <table class="directive">
135 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable evaluation of <var>X-Sendfile</var> pseudo response
137 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxySCGISendfile On|Off|<var>Headername</var></code></td></tr>
138 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxySCGISendfile Off</code></td></tr>
139 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
140 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
141 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_scgi</td></tr>
143 <p>The <code class="directive">ProxySCGISendfile</code> directive enables the
144 SCGI backend to let files be served directly by the gateway. This is useful
145 for performance purposes — httpd can use <code>sendfile</code> or other
146 optimizations, which are not possible if the file comes over the backend
147 socket. Additionally, the file contents are not transmitted twice.</p>
148 <p>The <code class="directive">ProxySCGISendfile</code> argument determines the
149 gateway behaviour:</p>
151 <dt><code>Off</code></dt>
152 <dd>No special handling takes place.</dd>
154 <dt><code>On</code></dt>
155 <dd>The gateway looks for a backend response header called
156 <code>X-Sendfile</code> and interprets the value as the filename to serve.
157 The header is removed from the final response headers. This is equivalent to
158 <code>ProxySCGISendfile X-Sendfile</code>.</dd>
160 <dt>anything else</dt>
161 <dd>Similar to <code>On</code>, but instead of the hardcoded header name
162 <code>X-Sendfile</code>, the argument is used as the header name.</dd>
165 <div class="example"><h3>Example</h3><pre class="prettyprint lang-config"># Use the default header (X-Sendfile)
168 # Use a different header
169 ProxySCGISendfile X-Send-Static</pre>
174 <div class="bottomlang">
175 <p><span>Available Languages: </span><a href="../en/mod/mod_proxy_scgi.html" title="English"> en </a></p>
176 </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&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>
177 <script type="text/javascript"><!--//--><![CDATA[//><!--
178 var comments_shortname = 'httpd';
179 var comments_identifier = 'http://httpd.apache.org/docs/trunk/mod/mod_proxy_scgi.html';
181 if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
182 d.write('<div id="comments_thread"><\/div>');
183 var s = d.createElement('script');
184 s.type = 'text/javascript';
186 s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
187 (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
190 d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
192 })(window, document);
193 //--><!]]></script></div><div id="footer">
194 <p class="apache">Copyright 2015 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>
195 <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[//><!--
196 if (typeof(prettyPrint) !== 'undefined') {