概述
现在腾讯提供免费的一年证书,地址:https://console.qcloud.com/sslnginx重定向 http 自动跳转 httpsserver{listen 80;server_name app.typecho.me;index index.html index.htm index.php;rewrite ^/(.*)$ https://plugins.typecho.me/$1 permanent;}配置ssl证书:server{listen 443;#listen [::]:80;server_name app.typecho.me;index index.html index.htm index.php;root /app;ssl on;ssl_certificate /ssl/app.typecho.me_cert.crt;ssl_certificate_key /ssl/app.typecho.me.key;include typecho.conf;#error_page 404 /404.html;include enable-php-pathinfo.conf;location ~ .*.(gif|jpg|jpeg|png|bmp|swf)${expires 30d;}location ~ .*.(js|css)?${expires 12h;}location ~ /.{deny all;}access_log off;}安装完成。腾讯免费SSL证书+LNMP环境演示:https://app.typecho.me/现在腾讯提供免费的一年证书,地址:https://console.qcloud.com/ssl
server { Listen 80; server_name app.typecho.me; index index.HTML index.htm index.PHP; rewrite ^/(.*)$ https://plugins.typecho.me/$1 permanent; }
配置ssl证书:
server { Listen 443; #Listen [::]:80; server_name app.typecho.me; index index.HTML index.htm index.PHP; root /app;ssl on; ssl_certificate /ssl/app.typecho.me_cert.crt; ssl_certificate_key /ssl/app.typecho.me.key; include typecho.conf; #error_page <a href="https://www.jb51.cc/tag/404/" target="_blank" class="keywords">404</a> /<a href="https://www.jb51.cc/tag/404/" target="_blank" class="keywords">404</a>.<a href="https://m.jb51.cc/tag/HTML/" target="_blank" class="keywords">HTML</a>; include enable-<a href="https://www.jb51.cc/tag/PHP/" target="_blank" class="keywords">PHP</a>-pathinfo.conf; location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(<a href="https://m.jb51.cc/tag/Js/" target="_blank" class="keywords">Js</a>|<a href="https://m.jb51.cc/tag/CSS/" target="_blank" class="keywords">CSS</a>)?$ { expires 12h; } location ~ /\. { deny all; } access_log off; }</pre>
总结
以上是编程之家为你收集整理的LNMP环境配置SSL证书最简单教程全部内容,希望文章能够帮你解决LNMP环境配置SSL证书最简单教程所遇到的程序开发问题。
如果觉得编程之家网站内容还不错,欢迎将编程之家网站推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。