美文网首页
现在批量绑定https

现在批量绑定https

作者: 蛐蛐儿阳 | 来源:发表于2021-04-29 11:15 被阅读0次

1, 就是说你拿到域名, 先怀米批量绑定
2, 域名贴进mk.php , 运行 php mk.php
3, 重启服务器。

以上是http域名可访问, 才能生成秘钥不报错。

4, 批量执行 生成秘钥命令。
acme.sh --issue -d huchic.com -w /www/wwwroot/shoes/
5, 域名批量贴入mk2.php
6, php mk2.php 运行生成nginx文件。
7, 重启nginx, 大工告成。

1,
mk.php 内容

<?php
// http可访问的源文件
$source='./http.test';
// 批量要 修改的域名
$arr = [
'glcia.com',
'gdhawk.com',
'gtminde.com',
'gpchic.com',
'gpminde.com',
'huchic.com',
'gncia.com',
'gwhawk.com',
];
// 修改其内容
foreach ($arr as $v) {
    fopen("./".$v.".conf", "w");
    $content = file_get_contents($source);

    $c1 = str_replace("inserre.com", $v, $content);
    file_put_contents("./".$v.".conf", $c1);
}

http.test 内容

server
{
    listen 80;
    server_name inserre.com www.inserre.com;
    index index.php index.html index.htm default.php default.htm default.html;
    root /www/wwwroot/shoes;

    #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
    #error_page 404/404.html;

    #SSL-END

    #ERROR-PAGE-START  错误页配置,可以注释、删除或修改
    #error_page 404 /404.html;
    #error_page 502 /502.html;
    #ERROR-PAGE-END
#禁止访问的文件或目录
    location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
    {
        return 404;
    }

    #一键申请SSL证书验证目录相关设置
    location ~ \.well-known{
        allow all;
    }

    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
        expires      30d;
        error_log /dev/null;
        access_log off;
    }

    location ~ .*\.(js|css)?$
    {
        expires      12h;
        error_log /dev/null;
        access_log off;
    }
    access_log  /www/wwwlogs/inserre.com.log;
    error_log  /www/wwwlogs/inserre.com.error.log;
}

mk2.php 内容

<?php
// 有秘钥,可直接https访问的域名
$source='./bqdrone.com.conf';
// 批量域名
$arr = [
'glcia.com',
'gdhawk.com',
'gtminde.com',
'gpchic.com',
'gpminde.com',
'huchic.com',
'gncia.com',
'gwhawk.com',
];
// 批量生成文件
foreach ($arr as $v) {
    fopen("./".$v.".conf", "w");
    $content = file_get_contents($source);

    $c1 = str_replace("bqdrone.com", $v, $content);
    file_put_contents("./".$v.".conf", $c1);
}

bqdrone.com.conf内容

server
{
    listen 80;
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
    listen [::]:80;
    server_name bqdrone.com www.bqdrone.com;
    index index.php index.html index.htm default.php default.htm default.html;
    root /www/wwwroot/shoes;
    
    #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
    #error_page 404/404.html;
    #SSL-END
    ssl_certificate    /root/.acme.sh/bqdrone.com/bqdrone.com.cer;
    ssl_certificate_key /root/.acme.sh/bqdrone.com/bqdrone.com.key;
    ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;
    error_page 497  https://$host$request_uri;
    #ERROR-PAGE-START  错误页配置,可以注释、删除或修改
    #error_page 404 /404.html;
    #error_page 502 /502.html;
    #ERROR-PAGE-END
   location / {
        #—————————Zen-Cart Rewrite Start———————
        # From Ultimate SEO URLs
        rewrite "^(.*)-p-(.*).html" /index.php?main_page=product_info&products_id=$2&% last;
        rewrite "^(.*)-c-(.*).html" /index.php?main_page=index&cPath=$2&% last;
        rewrite "^(.*)-m-([0-9]+).html" /index.php?main_page=index&manufacturers_id=$2&% last;
        rewrite "^(.*)-pi-([0-9]+).html" /index.php?main_page=popup_image&pID=$2&% last;
        rewrite "^(.*)-pr-([0-9]+).html" /index.php?main_page=product_reviews&products_id=$2&% last;
        rewrite "^(.*)-pri-([0-9]+).html" /index.php?main_page=product_reviews_info&products_id=$2&% last;
        # For Open Operations Info Manager
        rewrite "^(.*)-i-([0-9]+).html" /index.php?main_page=info_manager&pages_id=$2&% last;
        # For dreamscape’s News & Articles Manager
        rewrite "^news/?" /index.php?main_page=news&% last;
        rewrite "^news/rss.xml" /index.php?main_page=news_rss&% last;
        rewrite "^news/archive/?" /index.php?main_page=news_archive&% last;
        rewrite "^news/([0-9]{4})-([0-9]{2})-([0-9]{2}).html" /index.php?main_page=news&date=$1-$2-$3&% last;
        rewrite "^news/archive/([0-9]{4})-([0-9]{2}).html" /index.php?main_page=news_archive&date=$1-$2&% last;
        rewrite "^news/(.*)-a-([0-9]+)-comments.html" /index.php?main_page=news_comments&article_id=$2&% last;
        rewrite "^news/(.*)-a-([0-9]+).html" /index.php?main_page=news_article&article_id=$2&% last;

        rewrite "^/(.*)-c-([0-9_]+)/" /index.php?main_page=index&cPath=$2&$args last;
        rewrite "^/(.*)-ezp-([0-9]+)\.html" /index.php?main_page=page&id=$2&% last;

        # All other pages
        # Don’t rewrite real files or directories
        #RewriteCond %{REQUEST_FILENAME} !-f [NC]
        #RewriteCond %{REQUEST_FILENAME} !-d
        rewrite "^(.*).html" /index.php?main_page=$1&% last;
        #—————————Zen-Cart Rewrite End—————————
    }
    #PHP-INFO-START  PHP引用配置,可以注释或修改
    include enable-php-56.conf;
    #PHP-INFO-END
    
    #REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
    #REWRITE-END
    
    #禁止访问的文件或目录
    location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
    {
        return 404;
    }
    
    #一键申请SSL证书验证目录相关设置
    location ~ \.well-known{
        allow all;
    }
    
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
        expires      30d;
        error_log /dev/null;
        access_log off;
    }
    
    location ~ .*\.(js|css)?$
    {
        expires      12h;
        error_log /dev/null;
        access_log off; 
    }
    access_log  /www/wwwlogs/bqdrone.com.log;
    error_log  /www/wwwlogs/bqdrone.com.error.log;
}

批量跳https http不能访问

server {
        listen 80;      #监听ipv4
        listen [::]:80; #监听ipv6
        server_name inminde.com www.inminde.com;  #虚拟主机域名
        rewrite ^(.*)$ https://$host$1 permanent;       #rewrite跳转
}

相关文章

  • 现在批量绑定https

    1, 就是说你拿到域名, 先怀米批量绑定2, 域名贴进mk.php , 运行 php mk.php3, 重启...

  • 批量生成https

    题目是,今天拿到了一百个域名,要求给布置到某个服务上面。 acme.sh[http://acme.sh] --is...

  • swift Https单向绑定

    网上找了那么多,基本都是来源于同一出处的,正所谓天下文章一大抄,你抄我来我抄你! 基于Alamofire的http...

  • 26、C#委托

    在绑定按钮事件的使用场景里,如果想批量地绑定按钮事件,同时想通过绑定事件传递被点击按钮的名字,那么这时候可以通过委...

  • 思科mac、ip地址与接口绑定

    思科批量进入接口int rang fa0/1 - 48 mac动态绑定 2950 (config-if-range...

  • Oracle Bulk Binding 批量绑定

    批量绑定(Bulk Binding)通过一次绑定一个完整的集合,然后在PL/SQL块内部按照数组进行数据处理来加快...

  • 绑定到现在

    很多经济学的课程都是听下来了,感觉没深刻理解什么,倒是有一个词语刻进了心里,叫做成本。成本的理解很深奥,不是花了多...

  • MyBatis批量插入|更新数据(MySql)

    1、批量插入 2、批量更新 3、MyBatis Integer类型更新写法 参考文献:https://www.cn...

  • Cause: java.sql.SQLSyntaxErrorEx

    前言 最近写个 批量merge into超长语句,运行后发现报 ORA-01745::无效的主机/绑定变量名 错误...

  • 批量处理——把循环中产生的数据框合并

    这是对之前批量处理方法的一个补充,前面的文章 目录批量处理——for循环批量计算组间差异[https://www....

网友评论

      本文标题:现在批量绑定https

      本文链接:https://www.haomeiwen.com/subject/ounirltx.html