<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rudolf Maduro - Life Coach &#187; nginx</title>
	<atom:link href="http://www.rudolfmaduro.com/category/english/debian-lenny/nginx-debian-lenny-english/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rudolfmaduro.com</link>
	<description>Get a taste of Life with Online Life Coach Rudolf Maduro</description>
	<lastBuildDate>Fri, 16 Dec 2011 15:54:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<div style="float:right; padding-bottom:10px;">
<script type="text/javascript"><!--
google_ad_client = "pub-9572787728013152";
google_ad_width = 250;
google_ad_height = 250;
google_ad_format = "250x250_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "241a12";
google_color_bg = "241a12";
google_color_link = "585d8b";
google_color_url = "585d8b";
google_color_text = "333000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>	<item>
		<title>Passing IPs to apache with nginx proxy</title>
		<link>http://www.rudolfmaduro.com/2010/05/06/passing-ips-to-apache-with-nginx-proxy/</link>
		<comments>http://www.rudolfmaduro.com/2010/05/06/passing-ips-to-apache-with-nginx-proxy/#comments</comments>
		<pubDate>Thu, 06 May 2010 20:07:43 +0000</pubDate>
		<dc:creator>Rudolf</dc:creator>
				<category><![CDATA[nginx]]></category>
		<category><![CDATA[nginx proxy]]></category>
		<category><![CDATA[Passing IPs to apache with nginx proxy]]></category>
		<category><![CDATA[wrong IP]]></category>

		<guid isPermaLink="false">http://www.rudolfmaduro.com/?p=115</guid>
		<description><![CDATA[Passing IP&#8217;s to apache with nginx proxy When you use nginx as a proxy to an Apache backend server your apache will pick up the IP address of your nginx proxy as the clients IP.  Because of this your apache log files becomes useless and .htaccess IP based access control stops to work. Nginx provides [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Passing IP&#8217;s to apache with nginx proxy</strong></p>
<p>When you use nginx as a proxy to an Apache backend server your apache will pick up the IP address of your nginx proxy as the clients IP.  Because of this your apache log files becomes useless and .htaccess IP based access control stops to work.</p>
<p>Nginx provides a <em>HTTP X-Forwarded-For</em> header containing the clients real IP address however this is something apache will not notice by default.</p>
<p>You can configure apache to recognize the original client IP  from the<em> X-forwarded-for</em> as the original client IP with<br />
the help of the mod_rpaf apache module. On debian or ubuntu, this can be done by installing the rpaf package:</p>
<p><strong>&lt;shell&gt; sudo apt-get install  libapache2-mod-rpaf</strong></p>
<p>Once the mod_rpaf module has been installed, you need to reconfigure apache.<br />
You will need to add your nginx IP after the RPAFproxy_ips setting:</p>
<p>On a debian or ubuntu box you can edit the following file replacing  <strong>WWW.XXX.YYY.ZZZ</strong> for the IP of your nginx proxy if you run nginx and apache on the same box this IP might be the loopback address 127.0.0.1</p>
<p><strong>&lt;shell&gt; sudo nano etc/apache2/mods-available/rpaf.conf<br />
</strong><br />
<em>&lt;IfModule mod_rpaf.c&gt;<br />
RPAFenable On<br />
RPAFsethostname On<br />
RPAFproxy_ips <strong>WWW.XXX.YYY.ZZZ</strong><br />
&lt;/IfModule&gt;</em></p>
<p>If you installed the ubuntu package, this should be set up for you automatically in / .</p>
<p>Once you restart apache, you should be able to see the correct IP addresses in the apache access logs and .htacces IP<br />
based access should work again.</p>
<p>Rudolf Maduro &#8211; Life Coach &amp; IT specialist</p>
<p>www.rudolfmaduro.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rudolfmaduro.com/2010/05/06/passing-ips-to-apache-with-nginx-proxy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

