加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > LNMP > 正文

LNMP环境配置SSL证书最简单教程

发布时间:2020-12-13 22:00:07 所属栏目:LNMP 来源:网络整理
导读:现在腾讯提供免费的一年证书,地址:https://console.qcloud.com/ssl nginx重定向 http 自动跳转 https server { listen 80; server_name app.typecho.me; index index.html index.htm index.php; rewrite ^/(.*)$ https://plugins.typecho.me/$1 permanent;

现在腾讯提供免费的一年证书,地址:https://console.qcloud.com/ssl

nginx重定向 http 自动跳转 https

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   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;
}</pre>

安装完成。腾讯免费SSL证书+LNMP环境演示:https://app.typecho.me/

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读