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.2</p> 20<img alt="" src="/images/feather.gif" /></div> 21<div class="up"><a href="./"><img title="<-" alt="<-" src="/images/left.gif" /></a></div> 22<div id="path"> 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.2</a> > <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"> en </a> | 28<a href="/ja/mod/mod_proxy_scgi.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a></p> 29</div> 30<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> 31<tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr> 32<tr><th><a href="module-dict.html#ModuleIdentifier">Module�Identifier:</a></th><td>proxy_scgi_module</td></tr> 33<tr><th><a href="module-dict.html#SourceFile">Source�File:</a></th><td>mod_proxy_scgi.c</td></tr> 34<tr><th><a href="module-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.2.14 and later</td></tr></table> 35<h3>Summary</h3> 36 37 <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 38 <a href="http://python.ca/scgi/protocol.txt">SCGI protocol, version 39 1</a>.</p> 40 41 <p>Thus, in order to get the ability of handling the SCGI protocol, 42 <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 43 be present in the server.</p> 44 45 <div class="warning"><h3>Warning</h3> 46 <p>Do not enable proxying until you have <a href="mod_proxy.html#access">secured your server</a>. Open proxy 47 servers are dangerous both to your network and to the Internet at 48 large.</p> 49 </div> 50</div> 51<div id="quickview"><h3 class="directives">Directives</h3> 52<ul id="toc"> 53<li><img alt="" src="/images/down.gif" /> <a href="#proxyscgiinternalredirect">ProxySCGIInternalRedirect</a></li> 54<li><img alt="" src="/images/down.gif" /> <a href="#proxyscgisendfile">ProxySCGISendfile</a></li> 55</ul> 56<h3>Topics</h3> 57<ul id="topics"> 58<li><img alt="" src="/images/down.gif" /> <a href="#examples">Examples</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><p><code> 71 ProxyPass /scgi-bin/ scgi://localhost:4000/ 72 </code></p></div> 73 74 <p>The balanced gateway needs <code class="module"><a href="/mod/mod_proxy_balancer.html">mod_proxy_balancer</a></code> in 75 addition to the already mentioned proxy modules.</p> 76 77 <div class="example"><h3>Balanced gateway</h3><p><code> 78 ProxyPass /scgi-bin/ balancer://somecluster/<br /> 79 <Proxy balancer://somecluster/><br /> 80 <span class="indent"> 81 BalancerMember scgi://localhost:4000/<br /> 82 BalancerMember scgi://localhost:4001/<br /> 83 </span> 84 </Proxy> 85 </code></p></div> 86</div> 87<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 88<div class="directive-section"><h2><a name="ProxySCGIInternalRedirect" id="ProxySCGIInternalRedirect">ProxySCGIInternalRedirect</a> <a name="proxyscgiinternalredirect" id="proxyscgiinternalredirect">Directive</a></h2> 89<table class="directive"> 90<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable or disable internal redirect responses from the 91backend</td></tr> 92<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxySCGIInternalRedirect On|Off</code></td></tr> 93<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxySCGIInternalRedirect On</code></td></tr> 94<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr> 95<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr> 96<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_scgi</td></tr> 97</table> 98 <p>The <code class="directive">ProxySCGIInternalRedirect</code> enables the backend 99 to internally redirect the gateway to a different URL. This feature 100 origins in <code class="module"><a href="/mod/mod_cgi.html">mod_cgi</a></code>, which internally redirects the 101 response, if the response status is <code>OK</code> (<code>200</code>) and 102 the response contains a <code>Location</code> header and its value starts 103 with a slash (<code>/</code>). This value is interpreted as a new local 104 URL the apache internally redirects to.</p> 105 106 <p><code class="module"><a href="/mod/mod_proxy_scgi.html">mod_proxy_scgi</a></code> does the same as 107 <code class="module"><a href="/mod/mod_cgi.html">mod_cgi</a></code> in this regard, except that you can turn off the 108 feature.</p> 109 110 <div class="example"><h3>Example</h3><p><code> 111 ProxySCGIInternalRedirect Off 112 </code></p></div> 113 114</div> 115<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div> 116<div class="directive-section"><h2><a name="ProxySCGISendfile" id="ProxySCGISendfile">ProxySCGISendfile</a> <a name="proxyscgisendfile" id="proxyscgisendfile">Directive</a></h2> 117<table class="directive"> 118<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable evaluation of <var>X-Sendfile</var> pseudo response 119header</td></tr> 120<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ProxySCGISendfile On|Off|<var>Headername</var></code></td></tr> 121<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ProxySCGISendfile Off</code></td></tr> 122<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr> 123<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr> 124<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_proxy_scgi</td></tr> 125</table> 126 <p>The <code class="directive">ProxySCGISendfile</code> directive enables the 127 SCGI backend to let files serve directly by the gateway. This is useful 128 performance purposes -- the httpd can use <code>sendfile</code> or other 129 optimizations, which are not possible if the file comes over the backend 130 socket.</p> 131 <p>The <code class="directive">ProxySCGISendfile</code> argument determines the 132 gateway behaviour:</p> 133 <dl> 134 <dt><code>Off</code></dt> 135 <dd>No special handling takes place.</dd> 136 137 <dt><code>On</code></dt> 138 <dd>The gateway looks for a backend response header called 139 <code>X-Sendfile</code> and interprets the value as filename to serve. The 140 header is removed from the final response headers. This is equivalent to 141 <code>ProxySCGISendfile X-Sendfile</code>.</dd> 142 143 <dt>anything else</dt> 144 <dd>Similar to <code>On</code>, but instead of the hardcoded header name 145 the argument is applied as header name.</dd> 146 </dl> 147 148 <div class="example"><h3>Example</h3><p><code> 149 # Use the default header (X-Sendfile)<br /> 150 ProxySCGISendfile On<br /> 151 <br /> 152 # Use a different header<br /> 153 ProxySCGISendfile X-Send-Static 154 </code></p></div> 155 156</div> 157</div> 158<div class="bottomlang"> 159<p><span>Available Languages: </span><a href="/en/mod/mod_proxy_scgi.html" title="English"> en </a> | 160<a href="/ja/mod/mod_proxy_scgi.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a></p> 161</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> 162<script type="text/javascript"><!--//--><![CDATA[//><!-- 163var comments_shortname = 'httpd'; 164var comments_identifier = 'http://httpd.apache.org/docs/2.2/mod/mod_proxy_scgi.html'; 165(function(w, d) { 166 if (w.location.hostname.toLowerCase() == "httpd.apache.org") { 167 d.write('<div id="comments_thread"><\/div>'); 168 var s = d.createElement('script'); 169 s.type = 'text/javascript'; 170 s.async = true; 171 s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; 172 (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); 173 } 174 else { 175 d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); 176 } 177})(window, document); 178//--><!]]></script></div><div id="footer"> 179<p class="apache">Copyright 2013 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> 180<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[//><!-- 181if (typeof(prettyPrint) !== 'undefined') { 182 prettyPrint(); 183} 184//--><!]]></script> 185</body></html>