	
<?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: nginx + varnish + apache + SSL ( working fine )	</title>
	<atom:link href="https://jason.163-8.com/2022/09/21/nginx-varnish-apache-ssl-working-fine/feed/" rel="self" type="application/rss+xml" />
	<link>https://jason.163-8.com/2022/09/21/nginx-varnish-apache-ssl-working-fine/</link>
	<description>ส่วนตัวครับ</description>
	<lastBuildDate>Wed, 21 Sep 2022 07:01:48 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.0.11</generator>
	<item>
		<title>
		By: jason		</title>
		<link>https://jason.163-8.com/2022/09/21/nginx-varnish-apache-ssl-working-fine/#comment-12</link>

		<dc:creator><![CDATA[jason]]></dc:creator>
		<pubDate>Wed, 21 Sep 2022 07:01:48 +0000</pubDate>
		<guid isPermaLink="false">https://jason.163-8.com/?p=1089#comment-12</guid>

					<description><![CDATA[An infinite loop (besides already mentioned by the TS) might occur if you detect HTTP in .htaccess and redirects to HTTPS using mod_rewrite.

You should check and update mod_rewrite rules in .htaccess to rely on X-Forwarded-Proto:

Code:

RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


You might try and add:

Code:

&lt;IfModule setenvif_module&gt;
    SetEnvIf X-Forwarded-Proto &quot;^https$&quot; HTTPS=on
    SetEnvIf X-Forwarded-Proto &quot;^https$&quot; X_SERVER_PORT=443
    SetEnvIf X-Forwarded-Proto &quot;^https$&quot; X_REQUEST_SCHEME=https
&lt;/IfModule&gt;


into /etc/httpd/conf/extra/httpd-includes.conf and restart Apache.]]></description>
			<content:encoded><![CDATA[<p>An infinite loop (besides already mentioned by the TS) might occur if you detect HTTP in .htaccess and redirects to HTTPS using mod_rewrite.</p>
<p>You should check and update mod_rewrite rules in .htaccess to rely on X-Forwarded-Proto:</p>
<p>Code:</p>
<p>RewriteEngine On<br />
RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC]<br />
RewriteRule ^ <a href="https://%" rel="nofollow ugc">https://%</a>{HTTP_HOST}%{REQUEST_URI} [L,R=301]</p>
<p>You might try and add:</p>
<p>Code:</p>
<p><ifmodule setenvif_module><br />
    SetEnvIf X-Forwarded-Proto &#8220;^https$&#8221; HTTPS=on<br />
    SetEnvIf X-Forwarded-Proto &#8220;^https$&#8221; X_SERVER_PORT=443<br />
    SetEnvIf X-Forwarded-Proto &#8220;^https$&#8221; X_REQUEST_SCHEME=https<br />
</ifmodule></p>
<p>into /etc/httpd/conf/extra/httpd-includes.conf and restart Apache.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
