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

现在腾讯提供免费的一年证书,地址: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/

相关文章

本篇内容介绍了“LNMP服务器环境配置实例分析”的有关知识,...
本篇内容主要讲解“OneinStack如何一键安装LNMP”,感兴趣的...
小编给大家分享一下如何解决LNMP安装composer install时出现...
1.源码安装mysql鉴于前边的文章已经详细说过mysql的源码安装...
Linux是非常热门的技术,也是当下非常受欢迎的操作系统,具有...
██【電:131.乀.1418.乀.6667】【薇q:9788....