<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">dear all,<div><br></div><div>another deployment question :)</div><div>suroundings: catalyst, psgi, starman, apache2.</div><div>but in our setup there are *two* apache2s doing reverse proxies before the requests reaches the starman server.</div><div><br></div><div>so what happend:</div><div><br></div><div>the http headers look like this (for catalyst)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>X-FORWARDED-FOR: &lt;clients-ip&gt;, &lt;proxy2-ip&gt;&nbsp;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>REQUEST_IP_ADDRESS: &lt;proxy2-ip&gt;&nbsp;</div><div><br></div><div>what&nbsp;Plack::Middleware::ReverseProxy does it puts the LAST ip in the forwarded-for header into&nbsp;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>$env-&gt;{REMOTE_ADDR}</div><div>which is actually not the IP of the client.</div><div>why is that happening ?</div><div>shouldn't it take the first IP, so catalyst has access to the original requests IP ?</div><div><br></div><div>my apache proxy configs look like this...</div><div>is there something wrong with the proxies config &nbsp;?</div><div><br></div><div>thanks for hints!</div><div>cheers, bernhard</div><div><br></div><div><br></div><div><br></div><div><br></div><div>--------------------</div><div>proxy 1 (connectivity from "outside")-</div><div><br></div><div><div>&lt;VirtualHost *:80&gt;</div></div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; ServerName <a href="http://publicdomain.com">publicdomain.com</a><br><br><span class="Apple-tab-span" style="white-space:pre">        </span>ProxyRequests Off<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;Proxy *&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Order deny,allow<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Allow from all<br>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/Proxy&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; ProxyPass &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; / &nbsp; &nbsp; <span class="Apple-tab-span" style="white-space:pre">                </span>&nbsp; <a href="http://10.0.200.8:80/">http://10.0.200.8:80/</a><br>&nbsp; &nbsp; &nbsp; &nbsp; ProxyPassReverse &nbsp; &nbsp; &nbsp; &nbsp;/ &nbsp; <span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp; &nbsp; <a href="http://10.0.200.8:80/">http://10.0.200.8:80/</a><br>&nbsp; &nbsp; &nbsp; &nbsp; ProxyPreserveHost &nbsp; &nbsp; &nbsp; On<br>&lt;/VirtualHost&gt;</div><div><br></div><div><div>--------------------</div><div>proxy 2 (connectivity from "inside")</div></div><div><br></div><div><br></div><div>&lt;VirtualHost *:80&gt;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>ServerName <a href="http://publicdomain.com">publicdomain.com</a></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span># don't loose time with IP address lookups&nbsp;<br><span class="Apple-tab-span" style="white-space:pre">        </span>HostnameLookups Off<br><span class="Apple-tab-span" style="white-space:pre">        </span># helpful for named virtual hosts&nbsp;<br><span class="Apple-tab-span" style="white-space:pre">        </span>UseCanonicalName Off<br><br><span class="Apple-tab-span" style="white-space:pre">        </span># ---------------------------<br><span class="Apple-tab-span" style="white-space:pre">        </span># HANDLE STATIC FILES<br><span class="Apple-tab-span" style="white-space:pre">        </span># ---------------------------<br><span class="Apple-tab-span" style="white-space:pre">        </span>Alias &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /static &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /usr/local/....MyApp/root/static<br><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;Location /static&gt;<br><span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp; &nbsp; SetHandler default-handler<br><span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp; &nbsp; # allow access (thats new in apache 2.4. see <a href="http://httpd.apache.org/docs/2.4/upgrading.html#access">http://httpd.apache.org/docs/2.4/upgrading.html#access</a>)<br><span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp; &nbsp; Require all granted<br><span class="Apple-tab-span" style="white-space:pre">        </span>&lt;/Location&gt;<br><span class="Apple-tab-span" style="white-space:pre">        </span>ProxyPass &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /static/ &nbsp; &nbsp;!<br><br><span class="Apple-tab-span" style="white-space:pre">        </span># ---------------------------<br><span class="Apple-tab-span" style="white-space:pre">        </span># DYNAMIC REQUESTS (starman)<br><span class="Apple-tab-span" style="white-space:pre">        </span># ---------------------------<br><span class="Apple-tab-span" style="white-space: pre;">        </span>RewriteEngine On<br><span class="Apple-tab-span" style="white-space:pre">        </span>ProxyPreserveHost On<br><br><span class="Apple-tab-span" style="white-space:pre">        </span>ProxyPass &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; / &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://localhost:5000/">http://localhost:5000/</a><br><span class="Apple-tab-span" style="white-space:pre">        </span>ProxyPassReverse &nbsp; &nbsp;/ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://localhost:5000/">http://localhost:5000/</a></div><div>&lt;/VirtualHost&gt;<br><br></div><div><br></div><div><br></div><div><br></div><div><br><div>
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>—</div><div>Bernhard Bauch</div><div>Webdevelopment</div><div><br></div><div><div>ZSI-Zentrum für Soziale Innovation GmbH<br>Centre for Social Innovation<br><br>Linke Wienzeile 246, A-1150 Wien, Austria</div><div>Mail:&nbsp;<a href="mailto:bauch@zsi.at">bauch@zsi.at</a></div></div><div>Skype: berni-zsi</div><div><br></div><div><br></div></div></div></div></div><br class="Apple-interchange-newline">
</div>
<br></div></body></html>