nginx+wordpress安装SSL实现https访问 Linux

nginx+wordpress安装SSL实现https访问

nginx配置文件修改支持https 将下面的内容放入/usr/local/nginx/conf/vhost/favorbook.com.conf server { listen 80; server_name favorbook.com; return 301 https://$host$request_uri; } server { listen 443 ssl; server_name favorbook.com; ssl_certificate /root/ssl/unified.crt; ssl_certificate_key /root/ssl/my-private-decrypted.key; index index.html index.htm index.php default.html default.htm default.php; root /home/wwwroot/favorbook.com; include wordpress.conf; #error_page 404 /404.html; location ~ [^/].php(/|$) { # comment try_files $uri =404; to enable pathinfo try_files $uri =404; fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index.php; include fastcgi.conf; #include pathinfo.conf; } location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*.(js|css)?$ { expires 12h; } access_log /home/wwwlogs/favorbook.com.log access; } wordpress支持https跳转 参考: https://blog.shiniv.com/2014/06/open-http-and-https-in-wordpress/...
阅读全文
lnmpa环境下网站http跳转https Linux

lnmpa环境下网站http跳转https

Https优势 1. 防流量劫持 全站Https是根治运营商、中间人流量劫持的解决方案,不仅可以杜绝网页中被插入的小广告,更可以保护用户隐私安全。 2. 提升搜索排名 采用Https可以帮忙搜索排名的提升,提高站点的可信度和品牌形象。 3. 杜绝钓鱼网站 Https地址栏绿色图标可以帮助用户识别出钓鱼网站,保障用户和企业的利益不受损害,增强用户信任。 首先先从网络服务厂商下载ssl证书 例如 www.xxx.com.key www.xxx.com.crt 解释: SSLEngine :启用SSL功能 SSLCertificateFile:证书文件 SSLCertificateKeyFile:私钥文件 SSLCertificateChainFile: 证书链文件 最高为ca 和域名一样 你的网站》服务商》CA 请先配置lnmpa环境 然后执行下面操作 对于lnmpa环境需要2个都配置ssl 0. 首先 在 /usr/local/ 下建立个存放证书的文件夹 mkdir /usr/local/crt 把证书和key仍进去  证书可能要成份 1.nginx配置 #http服务器 upstream httpServer { server 127.0.0.1:88 weight=1 max_fails=2 fail_timeout=30s; } #https服务器 upstream httpsServer { server 127.0.0.1:442 weight=1 max_fails=2 fail_timeout=30s; } #用户默认访问80的端口 重定向https server { listen 80; server_name www.dorodoro.com dorodoro.com; rewrite ^(.*)$  https://$host$1 permanent; } server { listen 443 ssl; server_name www.dorodoro.com dorodoro.com; root          /var/lnmp/www/tolotolo; ssl...
阅读全文