<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Apache on Puppeteers Oy</title>
		<link>https://www.puppeteers.net/tags/apache/</link>
		<description>Recent content in Apache on Puppeteers Oy</description>
		<generator>Hugo</generator>
		<language>en-US</language>
		
		
		
		
			<lastBuildDate>Fri, 04 Sep 2020 00:00:00 +0000</lastBuildDate>
		
			<atom:link href="https://www.puppeteers.net/tags/apache/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Restrict access to a location in Apache reverse proxy with TLS</title>
				<link>https://www.puppeteers.net/blog/restrict-access-to-a-location-in-apache-reverse-proxy-with-tls/</link>
				<pubDate>Fri, 04 Sep 2020 00:00:00 +0000</pubDate>
				<guid>https://www.puppeteers.net/blog/restrict-access-to-a-location-in-apache-reverse-proxy-with-tls/</guid>
				<description>&lt;p&gt;Ever had a case where you needed to use a name based Apache reverse proxy in front of some application server, while restring access to some proxied location at the same time? Here’s how to do it.&lt;/p&gt;&#xA;&lt;h3 id=&#34;first-define-a-virtual-host&#34;&gt;First define a virtual host:&lt;/h3&gt;&#xA;&lt;div class=&#34;code-block&#34;&gt;&#xA;    &lt;button class=&#34;code-copy&#34; type=&#34;button&#34; hidden aria-label=&#34;Copy code to clipboard&#34;&gt;&#xA;      &lt;span class=&#34;code-copy-label&#34; aria-hidden=&#34;true&#34;&gt;Copy&lt;/span&gt;&#xA;    &lt;/button&gt;&#xA;    &lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;VirtualHost *:443&amp;gt;&#xA;    ServerName myserver.example.com&lt;/code&gt;&lt;/pre&gt;&#xA;  &lt;/div&gt;&lt;h3 id=&#34;set-the-request-headers-you-are-of-course-using-tls-arent-you&#34;&gt;Set the request headers (you are of course using TLS, aren&amp;rsquo;t you):&lt;/h3&gt;&#xA;&lt;div class=&#34;code-block&#34;&gt;&#xA;    &lt;button class=&#34;code-copy&#34; type=&#34;button&#34; hidden aria-label=&#34;Copy code to clipboard&#34;&gt;&#xA;      &lt;span class=&#34;code-copy-label&#34; aria-hidden=&#34;true&#34;&gt;Copy&lt;/span&gt;&#xA;    &lt;/button&gt;&#xA;    &lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;RequestHeader set X-Forwarded-Proto &amp;#34;https&amp;#34;&#xA;RequestHeader set X-Forwarded-Port &amp;#34;443&amp;#34;&lt;/code&gt;&lt;/pre&gt;&#xA;  &lt;/div&gt;&lt;h3 id=&#34;proxy-to-some-internal-address-here-to-localhost-port-8080&#34;&gt;Proxy to some internal address, here to localhost port 8080:&lt;/h3&gt;&#xA;&lt;div class=&#34;code-block&#34;&gt;&#xA;    &lt;button class=&#34;code-copy&#34; type=&#34;button&#34; hidden aria-label=&#34;Copy code to clipboard&#34;&gt;&#xA;      &lt;span class=&#34;code-copy-label&#34; aria-hidden=&#34;true&#34;&gt;Copy&lt;/span&gt;&#xA;    &lt;/button&gt;&#xA;    &lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ProxyRequests Off&#xA;ProxyPreserveHost On&#xA;ProxyPass http://127.0.0.1:8080/&#xA;ProxyPassReverse http://127.0.0.1:8080/&lt;/code&gt;&lt;/pre&gt;&#xA;  &lt;/div&gt;&lt;h3 id=&#34;restrict-access-to-the-host-or-networks-you-need-to&#34;&gt;Restrict access to the host or networks you need to:&lt;/h3&gt;&#xA;&lt;div class=&#34;code-block&#34;&gt;&#xA;    &lt;button class=&#34;code-copy&#34; type=&#34;button&#34; hidden aria-label=&#34;Copy code to clipboard&#34;&gt;&#xA;      &lt;span class=&#34;code-copy-label&#34; aria-hidden=&#34;true&#34;&gt;Copy&lt;/span&gt;&#xA;    &lt;/button&gt;&#xA;    &lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;Location &amp;#34;/my/location/&amp;#34;&amp;gt;&#xA; Require ip 10.0.0.0/8&#xA;&amp;lt;/Location&amp;gt;&lt;/code&gt;&lt;/pre&gt;&#xA;  &lt;/div&gt;&lt;p&gt;Note: this will work with Apache 2.4 and up. With older versions you can use the same idea.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
