1. Nginx
In your nginx site config file check if the value of X_FORWARDED_PROTO is https, if not, rewrite it:
1
2
3
4
5
6
7
8
9
10
|
server {
listen 80;
....
location / {
if ($http_x_forwarded_proto != 'https') {
rewrite ^ https://$host$request_uri? permanent;
}
....
}
}
|
2. Apache
Same goes for Apache, add this rewrite rule to your site’s config file:
1
2
3
4
5
6
7
|
<VirtualHost *:80>
...
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI}
...
</VirtualHost>
|
3. IIS
Install IIS Url-Rewrite module, using the configuration GUI add these settings
1
2
3
4
5
6
7
8
9
10
11
|
<rewrite xdt:Transform="Insert">
<rules>
<rule name="HTTPS rewrite behind ELB rule" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{HTTP_X_FORWARDED_PROTO}" pattern="^http$" ignoreCase="false" />
</conditions>
<action type="Redirect" redirectType="Found" url="https://{SERVER_NAME}{URL}" />
</rule>
</rules>
</rewrite>
|
Revisions
- January 13, 2016 @ 15:19:31 [Current Revision] by admin
- January 13, 2016 @ 15:19:31 by admin
Revision Differences
There are no differences between the January 13, 2016 @ 15:19:31 revision and the current revision. (Maybe only post meta information was changed.)
No comments yet.