nginx实现某个页面http访问,其余全部跳转到https

全站https实现某个页面可以http访问,其余全部跳转到https,注意下面的location,如果不加root 配置   找不到这个文件的
server { listen
80; server_name www.test.com; if ($request_uri !~* "/test-site-verification.txt") { rewrite ^(.*)$ https://$host$1 permanent; } location = /test-site-verification.txt { root /data/www/test; } access_log /data/logs/www/test_www_server-301.log; }

 

posted @ 2017-10-23 17:10  行知散人  阅读(2590)  评论(0编辑  收藏  举报