全站https实现某个页面可以http访问,其余全部跳转到https,注意下面的location,如果不加root 配置 找不到这个文件的server { listen ; server_name www.test.com; if ($request_uri !~* "/test-site-verification.txt") { rewrite ^(.*)$ https://$host$1 permanent; } location = /test-site-verification…
https介绍:   HTTPS(全称:Hypertext Transfer Protocol over Secure Socket Layer),是以安全为目标的HTTP通道,简单讲是HTTP的安全版.即HTTP下加入SSL层,HTTPS的安全基础是SSL,因此加密的详细内容就需要SSL. 它是一个URI scheme(抽象标识符体系),句法类同http:体系.用于安全的HTTP数据传输.https:URL表明它使用了HTTPS,但HTTPS存在不同于HTTP的默认端口及一个加密/身份验证层(…
1.限制爬虫配置 if ($http_user_agent ~* "spider|crapy|Sogou web spider|Baiduspider|Googlebot|Bingbot|360Spider|Yisouspider|Sogouspider|Yahoo! Slurp") { return 403; } 上述配置意思是,http_user_agent(对应浏览器参数User-agent)参数不区分大小写匹配到上述爬虫参数时,返回403. 该配置可以放置在server或loc…
if ($server_port != '443' ) { rewrite ^/(.*)$ https://cms-news.artron.net/$1 permanent; }…
1.首先在 httpd.conf里面修改几个地方 找到 #LoadModule ssl_module modules/mod_ssl.so 去掉前面的# Include conf/vhosts.conf  在这一行下面增加一行 Include conf/vhosts_ssl.conf 然后去conf文件夹里面创建vhosts_ssl.conf 2.在vhosts_ssl.conf里面写入 Listen 443 SSLStrictSNIVHostCheck off SSLCipherSuite A…
1.配置Tomcat,打开$CATALINA_HOME/conf/server.xml,修改如下 <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> 修改参数==> <Connector port="80" protocol="HTTP/1.1…
场景 Ubuntu Server 16.04 LTS上怎样安装下载安装Nginx并启动: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/102828075 Nginx的配置文件位置以及组成部分结构讲解: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/102829618 Linux-Ubuntu Server 16.04安装JDK以及配置JDK环境变量: ht…
一.Nginx安装(略)安装的时候需要注意加上 --with-http_ssl_module,因为http_ssl_module不属于Nginx的基本模块.Nginx安装方法: 1 2 # ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module # make && make install 二.生成证书(略)可以使用o…
Nginx的https配置记录以及http强制跳转到https的方法梳理 原文:http://www.cnblogs.com/kevingrace/p/6187072.html 一.Nginx安装(略)安装的时候需要注意加上 --with-http_ssl_module,因为http_ssl_module不属于Nginx的基本模块.Nginx安装方法: 1 2 # ./configure --user=www --group=www --prefix=/usr/local/nginx --wit…
感谢原文作者,为方便后期查阅转载,原文链接:https://www.cnblogs.com/xiefengdaxia123/p/8542737.html 通常情况下我们是用的都是http的路径,对于https的使用也很少,但是随着https的普及越来越多的域名访问需要用到https的,这个我们就演示怎么设置在我们对一个http的网站进行访问时候自动跳转至https下. 用到的工具及软件: 系统:windows2008R2软件:IIS7.0,IIS的microsoft URL重写模块2.0 操作步…