<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Checking for SSL behind a load balancer</title>
	<atom:link href="http://www.ghidinelli.com/2010/12/29/checking-for-ssl-behind-a-load-balancer/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ghidinelli.com/2010/12/29/checking-for-ssl-behind-a-load-balancer</link>
	<description></description>
	<lastBuildDate>Thu, 01 Jun 2017 18:51:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Kurt Bonnet</title>
		<link>http://www.ghidinelli.com/2010/12/29/checking-for-ssl-behind-a-load-balancer/comment-page-1#comment-61505</link>
		<dc:creator>Kurt Bonnet</dc:creator>
		<pubDate>Fri, 31 Dec 2010 06:06:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghidinelli.com/?p=1191#comment-61505</guid>
		<description>@Brian - I&#039;m not sure about SetEnv, but according to the documentation for mod_headers if someone were to spoof the isSsl request header, and you specified a value for the isSsl header (that was spoofed) in your Apache config using:

RequestHeader set isSsl 1

the &quot;set&quot; command will replace any previously existing header with that name (isSsl) and apply the new value to it (from the config file), thus over-riding any spoofed values.

I haven&#039;t tested this out explicitly, but I&#039;m pretty sure it works as stated.

Apache mod_headers docs:
http://httpd.apache.org/docs/2.2/mod/mod_headers.html#requestheader</description>
		<content:encoded><![CDATA[<p>@Brian &#8211; I&#8217;m not sure about SetEnv, but according to the documentation for mod_headers if someone were to spoof the isSsl request header, and you specified a value for the isSsl header (that was spoofed) in your Apache config using:</p>
<p>RequestHeader set isSsl 1</p>
<p>the &#8220;set&#8221; command will replace any previously existing header with that name (isSsl) and apply the new value to it (from the config file), thus over-riding any spoofed values.</p>
<p>I haven&#8217;t tested this out explicitly, but I&#8217;m pretty sure it works as stated.</p>
<p>Apache mod_headers docs:<br />
<a href="http://httpd.apache.org/docs/2.2/mod/mod_headers.html#requestheader" rel="nofollow">http://httpd.apache.org/docs/2.2/mod/mod_headers.html#requestheader</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brian</title>
		<link>http://www.ghidinelli.com/2010/12/29/checking-for-ssl-behind-a-load-balancer/comment-page-1#comment-61495</link>
		<dc:creator>brian</dc:creator>
		<pubDate>Thu, 30 Dec 2010 20:23:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghidinelli.com/?p=1191#comment-61495</guid>
		<description>@Kurt - thanks, that&#039;s another great use of the Apache modules to provide assistance to CF.  I have often struggled with how to have a cluster of identically configured (from a CF perspective) machines but also not run the same scheduled tasks on every box.  Your header example above made me think that or the setenv approach might be a good way of doing it:

SetEnv SCHEDULED_TASKS_PERMITTED 1

The only problem with both the Env and the Header is that it can be spoofed by the user unless you delete it first using mod_rewrite, correct?</description>
		<content:encoded><![CDATA[<p>@Kurt &#8211; thanks, that&#8217;s another great use of the Apache modules to provide assistance to CF.  I have often struggled with how to have a cluster of identically configured (from a CF perspective) machines but also not run the same scheduled tasks on every box.  Your header example above made me think that or the setenv approach might be a good way of doing it:</p>
<p>SetEnv SCHEDULED_TASKS_PERMITTED 1</p>
<p>The only problem with both the Env and the Header is that it can be spoofed by the user unless you delete it first using mod_rewrite, correct?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kurt Bonnet</title>
		<link>http://www.ghidinelli.com/2010/12/29/checking-for-ssl-behind-a-load-balancer/comment-page-1#comment-61494</link>
		<dc:creator>Kurt Bonnet</dc:creator>
		<pubDate>Thu, 30 Dec 2010 19:08:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghidinelli.com/?p=1191#comment-61494</guid>
		<description>Great post. Just wanted to post another technique I&#039;ve used before for doing this. Much like your SetEnv in Apache, you can use the mod_headers module and set a request header and read it in from CF.

i.e.  
Apache Config:
RequestHeader set isSsl 1

Check in CF (In my Application.cfm/cfc):
headers = getHttpRequestData().headers;
request.a.isSslRequest = 0;
if(structKeyExists(headers, &quot;isSsl&quot;)) {
	request.a.isSslRequest = val(headers.isSsl);
}

...

if( NOT request.a.isSslRequest ) {
   redirect to secure location...
}

I&#039;ve also used this technique to help determine which actual OS/app instance installation my app is running within. In some of my apps I need to ensure scripts are only allowed to run on a particular OS/app installation so I&#039;ll do something like:

RequestHeader set AppInstance &quot;WS1&quot;

And then the &quot;WS1&quot; value/code corresponds to a field in my &quot;app_servers&quot; database table which has varying permissions/configuration values for each of my app server instances. This has made it easy to deal with a single code base that operates across multiple servers that are configured slightly different from one another and that have slight behavioral differences. Hope that makes sense.

Congrats on your recent racing win.</description>
		<content:encoded><![CDATA[<p>Great post. Just wanted to post another technique I&#8217;ve used before for doing this. Much like your SetEnv in Apache, you can use the mod_headers module and set a request header and read it in from CF.</p>
<p>i.e.<br />
Apache Config:<br />
RequestHeader set isSsl 1</p>
<p>Check in CF (In my Application.cfm/cfc):<br />
headers = getHttpRequestData().headers;<br />
request.a.isSslRequest = 0;<br />
if(structKeyExists(headers, &#8220;isSsl&#8221;)) {<br />
	request.a.isSslRequest = val(headers.isSsl);<br />
}</p>
<p>&#8230;</p>
<p>if( NOT request.a.isSslRequest ) {<br />
   redirect to secure location&#8230;<br />
}</p>
<p>I&#8217;ve also used this technique to help determine which actual OS/app instance installation my app is running within. In some of my apps I need to ensure scripts are only allowed to run on a particular OS/app installation so I&#8217;ll do something like:</p>
<p>RequestHeader set AppInstance &#8220;WS1&#8243;</p>
<p>And then the &#8220;WS1&#8243; value/code corresponds to a field in my &#8220;app_servers&#8221; database table which has varying permissions/configuration values for each of my app server instances. This has made it easy to deal with a single code base that operates across multiple servers that are configured slightly different from one another and that have slight behavioral differences. Hope that makes sense.</p>
<p>Congrats on your recent racing win.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brian</title>
		<link>http://www.ghidinelli.com/2010/12/29/checking-for-ssl-behind-a-load-balancer/comment-page-1#comment-61484</link>
		<dc:creator>brian</dc:creator>
		<pubDate>Thu, 30 Dec 2010 03:29:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.ghidinelli.com/?p=1191#comment-61484</guid>
		<description>If you wanted to provide maximum type safety, I&#039;d recommend using the following:

if (isBoolean(cgi.server_port_secure) AND cgi.server_port_secure) OR (isBoolean(cgi.bigipssl) AND cgi.bigipssl)</description>
		<content:encoded><![CDATA[<p>If you wanted to provide maximum type safety, I&#8217;d recommend using the following:</p>
<p>if (isBoolean(cgi.server_port_secure) AND cgi.server_port_secure) OR (isBoolean(cgi.bigipssl) AND cgi.bigipssl)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
