AM电脑吧 - Win10精简版系统_Win11精简版_Win7旗舰版

Yes
查看: 5619|回复: 0
收起左侧

[技巧] IIS7设置ssl以后443端口跳转80端口的伪静态规则

[复制链接]
ampc81

签到天数: 644 天

[LV.9]九级电脑高手

id 发表于 2017-06-24 08:32:03
安装ssl证书开启https加密访问以后最大的特点是443端口https页面跳转访问80端口的http页面..
网上看了很多教程都是各种设置,但是没有一个成功的..
最后去老外的网站找到了这个伪静态规则,亲测效果很好.

<rewrite>
        <rules>
<rule name="Redirect to HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions><add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" />
</rule>
        </rules>
</rewrite>

IIS7.jpg
关于nginx的伪静态规则:


server {
      
        listen 443;

        root /www/web/guwanlife/public_html;
        server_name www.ampc8.com www.ampc8.com;
        index  index.html index.php index.htm;
        error_page  400 /errpage/400.html;
        error_page  403 /errpage/403.html;
        error_page  404 /errpage/404.html;
        error_page  503 /errpage/503.html;
        ssl on;
ssl_certificate_key  /www/wdlinux/nginx/conf/pastdust.key;
ssl_certificate  /www/wdlinux/nginx/conf/pastdust.crt;

        location ~ \.php$ {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                include fcgi.conf;
        }
        location ~ /\.ht {
                deny  all;
        }
        include /www/wdlinux/wdcp/rewrite/dzx32_nginx.conf;
}
  server {
    listen      80;
    server_name    www.testcom;
    return      301 https://$server_name$request_uri;
}

本文地址: https://www.ampc8.com/thread-23617-1-1.html
上一篇:win7系统自动关闭显示器时间的设置方法
下一篇:导致win10卡顿的一个程序,删除Win10自带的恶意软件删除工具
回复

举报

您需要登录后才可以回帖 登录 | 验证注册

Powered by AMpc8.Com (晋ICP备13003365号ghs 晋公网安备 14090202000112号 |GMT+8, 2024/4/19 07:56 |
快速回复 返回顶部 返回列表