-
Notifications
You must be signed in to change notification settings - Fork 1
/
18543.html
836 lines (658 loc) · 32.1 KB
/
18543.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 3.9.0">
<script data-ad-client="ca-pub-6912066943609875" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<link rel="apple-touch-icon" sizes="180x180" href="/images/favicon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon.png">
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon.png">
<link rel="mask-icon" href="/images/logo.svg" color="#222">
<meta name="google-site-verification" content="googleacbf0c232246c14c">
<meta name="msvalidate.01" content="459FB2FD55046A1DECE2CCD9DDB4CDC6">
<meta name="baidu-site-verification" content="hxB6RGtiSLTYdVdv">
<link rel="stylesheet" href="/css/main.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/font-awesome@4/css/font-awesome.min.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/pace-js@1/themes/blue/pace-theme-minimal.css">
<script src="//cdn.jsdelivr.net/npm/pace-js@1/pace.min.js"></script>
<script id="hexo-configurations">
var NexT = window.NexT || {};
var CONFIG = {
hostname: new URL('https://zhaoqi.vip').hostname,
root: '/',
scheme: 'Gemini',
version: '7.7.1',
exturl: false,
sidebar: {"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},
copycode: {"enable":true,"show_result":true,"style":"mac"},
back2top: {"enable":true,"sidebar":true,"scrollpercent":false},
bookmark: {"enable":true,"color":"#222","save":"auto"},
fancybox: false,
mediumzoom: false,
lazyload: true,
pangu: false,
comments: {"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},
algolia: {
appID: '',
apiKey: '',
indexName: '',
hits: {"per_page":10},
labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
},
localsearch: {"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
path: 'search.xml',
motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}
};
</script>
<meta name="description" content="前言寒假的时候用Hexo+Github pages搭建了属于自己的博客,前不久才绑定了个人域名。作为一名有强迫症的程序猿,肯定还要给自己加一个绿色的小锁头。在网上看别人的博客,大部分是用的CloudFlare提供的免费https服务,也有采用的阿里云提供的一年免费证书,我选择的是后者。">
<meta name="keywords" content="Hexo,Github">
<meta property="og:type" content="article">
<meta property="og:title" content="Github pages个人域名添加SSL">
<meta property="og:url" content="https://zhaoqi.vip/18543.html">
<meta property="og:site_name" content="温柔小猪">
<meta property="og:description" content="前言寒假的时候用Hexo+Github pages搭建了属于自己的博客,前不久才绑定了个人域名。作为一名有强迫症的程序猿,肯定还要给自己加一个绿色的小锁头。在网上看别人的博客,大部分是用的CloudFlare提供的免费https服务,也有采用的阿里云提供的一年免费证书,我选择的是后者。">
<meta property="og:locale" content="zh-CN">
<meta property="og:updated_time" content="2021-09-24T05:33:49.231Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Github pages个人域名添加SSL">
<meta name="twitter:description" content="前言寒假的时候用Hexo+Github pages搭建了属于自己的博客,前不久才绑定了个人域名。作为一名有强迫症的程序猿,肯定还要给自己加一个绿色的小锁头。在网上看别人的博客,大部分是用的CloudFlare提供的免费https服务,也有采用的阿里云提供的一年免费证书,我选择的是后者。">
<link rel="canonical" href="https://zhaoqi.vip/18543.html">
<script id="page-configurations">
// https://hexo.io/docs/variables.html
CONFIG.page = {
sidebar: "",
isHome: false,
isPost: true
};
</script>
<title>Github pages个人域名添加SSL | 温柔小猪</title>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-117346785-1"></script>
<script>
if (CONFIG.hostname === location.hostname) {
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-117346785-1');
}
</script>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?4a17ce36d5c92a5726de69f0274ef237";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<noscript>
<style>
.use-motion .brand,
.use-motion .menu-item,
.sidebar-inner,
.use-motion .post-block,
.use-motion .pagination,
.use-motion .comments,
.use-motion .post-header,
.use-motion .post-body,
.use-motion .collection-header { opacity: initial; }
.use-motion .site-title,
.use-motion .site-subtitle {
opacity: initial;
top: initial;
}
.use-motion .logo-line-before i { left: initial; }
.use-motion .logo-line-after i { right: initial; }
</style>
</noscript>
</head>
<body itemscope itemtype="http://schema.org/WebPage">
<script src="/js/cursor/love.min.js"></script>
<script src="/js/activate-power-mode.min.js"></script>
<script>
POWERMODE.colorful = true;
POWERMODE.shake = false;
document.body.addEventListener('input', POWERMODE);
</script>
<!-- badApplePlayer -->
<script src="//lib.baomitu.com/jquery/3.3.1/jquery.min.js"></script>
<script src="https://myhkw.cn/api/player/158739178355" id="myhk" key="158739178355" m="1"></script>
<div class="container use-motion">
<div class="headband"></div>
<header class="header" itemscope itemtype="http://schema.org/WPHeader">
<div class="header-inner"><div class="site-brand-container">
<div class="site-meta">
<div>
<a href="/" class="brand" rel="start">
<span class="logo-line-before"><i></i></span>
<span class="site-title">温柔小猪</span>
<span class="logo-line-after"><i></i></span>
</a>
</div>
</div>
<div class="site-nav-toggle">
<div class="toggle" aria-label="切换导航栏">
<span class="toggle-line toggle-line-first"></span>
<span class="toggle-line toggle-line-middle"></span>
<span class="toggle-line toggle-line-last"></span>
</div>
</div>
</div>
<nav class="site-nav">
<ul id="menu" class="menu">
<li class="menu-item menu-item-home">
<a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>
</li>
<li class="menu-item menu-item-about">
<a href="/about/" rel="section"><i class="fa fa-fw fa-user"></i>关于</a>
</li>
<li class="menu-item menu-item-tags">
<a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签<span class="badge">32</span></a>
</li>
<li class="menu-item menu-item-categories">
<a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类<span class="badge">12</span></a>
</li>
<li class="menu-item menu-item-archives">
<a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档<span class="badge">34</span></a>
</li>
<li class="menu-item menu-item-search">
<a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
</a>
</li>
</ul>
</nav>
<div class="site-search">
<div class="popup search-popup">
<div class="search-header">
<span class="search-icon">
<i class="fa fa-search"></i>
</span>
<div class="search-input-container">
<input autocomplete="off" autocorrect="off" autocapitalize="none"
placeholder="搜索..." spellcheck="false"
type="text" id="search-input">
</div>
<span class="popup-btn-close">
<i class="fa fa-times-circle"></i>
</span>
</div>
<div id="search-result"></div>
</div>
<div class="search-pop-overlay"></div>
</div>
</div>
</header>
<div class="reading-progress-bar"></div>
<a role="button" class="book-mark-link book-mark-link-fixed"></a>
<a href="https://github.com/ZhaoQi99" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>
<main class="main">
<div class="main-inner">
<div class="content-wrap">
<div class="content">
<div class="posts-expand">
<article itemscope itemtype="http://schema.org/Article" class="post-block " lang="zh-CN">
<link itemprop="mainEntityOfPage" href="https://zhaoqi.vip/18543.html">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.png">
<meta itemprop="name" content="Zhao Qi">
<meta itemprop="description" content="">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="温柔小猪">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
Github pages个人域名添加SSL
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2018-04-10 11:08:11" itemprop="dateCreated datePublished" datetime="2018-04-10T11:08:11+08:00">2018-04-10</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="fa fa-folder-o"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/Hexo/" itemprop="url" rel="index">
<span itemprop="name">Hexo</span>
</a>
</span>
</span>
<span id="/18543.html" class="post-meta-item leancloud_visitors" data-flag-title="Github pages个人域名添加SSL" title="阅读次数">
<span class="post-meta-item-icon">
<i class="fa fa-eye"></i>
</span>
<span class="post-meta-item-text">阅读次数:</span>
<span class="leancloud-visitors-count"></span>
</span><br>
<span class="post-meta-item" title="本文字数">
<span class="post-meta-item-icon">
<i class="fa fa-file-word-o"></i>
</span>
<span class="post-meta-item-text">本文字数:</span>
<span>829</span>
</span>
<span class="post-meta-item" title="阅读时长">
<span class="post-meta-item-icon">
<i class="fa fa-clock-o"></i>
</span>
<span class="post-meta-item-text">阅读时长 ≈</span>
<span>1 分钟</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><p>寒假的时候用Hexo+Github pages搭建了属于自己的博客,前不久才绑定了个人域名。作为一名有强迫症的程序猿,肯定还要给自己加一个绿色的小锁头。<br>在网上看别人的博客,大部分是用的<a href="https://www.cloudflare.com/" target="_blank" rel="noopener">CloudFlare</a>提供的免费https服务,也有采用的阿里云提供的一年免费证书,我选择的是后者。<br><a id="more"></a></p>
<h2 id="准备"><a href="#准备" class="headerlink" title="准备"></a>准备</h2><ul>
<li>个人域名:<a href="https://zhaoqi99.github.io/" target="_blank" rel="noopener">https://赵旗.top/</a></li>
<li>Github pages</li>
<li>阿里云购买的SSL证书<h2 id="添加SSL证书"><a href="#添加SSL证书" class="headerlink" title="添加SSL证书"></a>添加SSL证书</h2></li>
</ul>
<ol>
<li>进入阿里云控制台,依次点击安全(云盾)->CA证书服务,然后点击右上角的购买证书。<br><img data-src="/images/20180410134416.jpg" alt></li>
<li>依次选择品牌为<code>Symantec</code>,保护类型为<code>一个域名</code>,证书类型此时会多出一个选项<code>免费型DV SSL</code>点击选择,然后点击立即购买,支付0.00元。<br><img data-src="/images/20180410134752.jpg" alt><br><img data-src="/images/20180410113516.jpg" alt><div class="note danger no-icon"><p>注意:免费的SSL证书有效期只有一年,过期之后就需要重新申请了。<br></p></div></li>
<li>支付成功后,点击进入证书控制台,然后点击<code>补全</code>,填写相关信息,提交申请。<br><img data-src="/images/20180410140626.jpg" alt><br><img data-src="/images/20180410113758.jpg" alt><div class="note warning"><p><br>域名验证类型选项记得勾选:证书绑定的域名在【阿里云的云解析】产品中,授权系统自动添加一条记录以完成域名授权验证。<br></p></div></li>
<li>等待20分钟左右,即可收到签发成功的通知了,也可以在证书控制台中实时看到审核进度。</li>
<li>在浏览器中输入https://域名/ ,可以看到地址栏前面有一个小绿锁,很惊喜有没有~<br><img data-src="/images/20180410140910.jpg" alt></li>
</ol>
<h2 id="http强制跳转https"><a href="#http强制跳转https" class="headerlink" title="http强制跳转https"></a>http强制跳转https</h2><p>按照上述步骤添加了SSL证书后,发现如果在地址栏中输入的是https://域名/ 就会有绿锁头,如果输入的是http://域名/ ,则还是http,并不会自动跳转至https。怎样让访客点击http://域名/ 时能强制跳转到https呢?<br>在Google上看了好多的博客都没能找到解决方案,突然发现Github上有一个<code>Enforce HTTPS</code>选项,抱着试一试的心态,最后竟然成功了。</p>
<ol>
<li>登录Github,进入自己的Github.io项目中,点击<code>Setting</code>,往下拉,可以看到有个选项叫<code>Enforce HTTPS</code>,点击勾选。<br><img data-src="/images/20180410115944.jpg" alt></li>
<li>打开浏览器,在地址中输入自己的http://域名/ ,已经可以自动跳转到https下了,大功告成。</li>
</ol>
<link rel="stylesheet" href="/css/spoiler.css" type="text/css"><script src="/js/spoiler.js" type="text/javascript" async></script>
</div>
<div class="popular-posts-header">相关文章</div>
<ul class="popular-posts">
<li class="popular-posts-item">
<div class="popular-posts-title"><a href="/24787.html" rel="bookmark">Hexo+Github pages博客绑定中文域名</a></div>
</li>
</ul>
<div class="reward-container">
<div>您的支持是我继续创作最大的动力!</div>
<button onclick="var qr = document.getElementById('qr'); qr.style.display = (qr.style.display === 'none') ? 'block' : 'none';">
打赏
</button>
<div id="qr" style="display: none;">
<div style="display: inline-block;">
<img src="/images/wechatpay.png" alt="Zhao Qi 微信支付">
<p>微信支付</p>
</div>
<div style="display: inline-block;">
<img src="/images/alipay.jpg" alt="Zhao Qi 支付宝">
<p>支付宝</p>
</div>
</div>
</div>
<div>
<ul class="post-copyright">
<li class="post-copyright-author">
<strong>本文作者: </strong>Zhao Qi
</li>
<li class="post-copyright-link">
<strong>本文链接:</strong>
<a href="https://zhaoqi.vip/18543.html" title="Github pages个人域名添加SSL">https://zhaoqi.vip/18543.html</a>
</li>
<li class="post-copyright-license">
<strong>版权声明: </strong>本博客所有文章除特别声明外,均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" rel="noopener" target="_blank"><i class="fa fa-fw fa-creative-commons"></i>BY-NC-SA</a> 许可协议。转载请注明出处!
</li>
</ul>
</div>
<div class="followme">
<p>欢迎关注我的其它发布渠道</p>
<div class="social-list">
<div class="social-item">
<a target="_blank" class="social-link" href="https://github.com/ZhaoQi99">
<span class="icon">
<i class="fa fa-github"></i>
</span>
<span class="label">Github</span>
</a>
</div>
<div class="social-item">
<a target="_blank" class="social-link" href="/atom.xml">
<span class="icon">
<i class="fa fa-rss"></i>
</span>
<span class="label">RSS</span>
</a>
</div>
</div>
</div>
<footer class="post-footer">
<div class="post-tags">
<a href="/tags/Hexo/" rel="tag"><i class="fa fa-tag"></i> Hexo</a>
<a href="/tags/Github/" rel="tag"><i class="fa fa-tag"></i> Github</a>
</div>
<div class="post-nav">
<div class="post-nav-item">
<a href="/45393.html" rel="prev" title="L2-3.名人堂与代金券">
<i class="fa fa-chevron-left"></i> L2-3.名人堂与代金券
</a></div>
<div class="post-nav-item">
<a href="/45013.html" rel="next" title="用Python实现校园通知更新提醒">
用Python实现校园通知更新提醒 <i class="fa fa-chevron-right"></i>
</a></div>
</div>
</footer>
</article>
</div>
</div>
<div class="comments" id="gitalk-container"></div>
<script>
window.addEventListener('tabs:register', () => {
let activeClass = CONFIG.comments.activeClass;
if (CONFIG.comments.storage) {
activeClass = localStorage.getItem('comments_active') || activeClass;
}
if (activeClass) {
let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
if (activeTab) {
activeTab.click();
}
}
});
if (CONFIG.comments.storage) {
window.addEventListener('tabs:click', event => {
if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
let commentClass = event.target.classList[1];
localStorage.setItem('comments_active', commentClass);
});
}
</script>
</div>
<div class="toggle sidebar-toggle">
<span class="toggle-line toggle-line-first"></span>
<span class="toggle-line toggle-line-middle"></span>
<span class="toggle-line toggle-line-last"></span>
</div>
<aside class="sidebar">
<div class="sidebar-inner">
<ul class="sidebar-nav motion-element">
<li class="sidebar-nav-toc">
文章目录
</li>
<li class="sidebar-nav-overview">
站点概览
</li>
</ul>
<!--noindex-->
<div class="post-toc-wrap sidebar-panel">
<div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#前言"><span class="nav-number">1.</span> <span class="nav-text">前言</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#准备"><span class="nav-number">2.</span> <span class="nav-text">准备</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#添加SSL证书"><span class="nav-number">3.</span> <span class="nav-text">添加SSL证书</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#http强制跳转https"><span class="nav-number">4.</span> <span class="nav-text">http强制跳转https</span></a></li></ol></div>
</div>
<!--/noindex-->
<div class="site-overview-wrap sidebar-panel">
<div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
<img class="site-author-image" itemprop="image" alt="Zhao Qi"
src="/images/avatar.png">
<p class="site-author-name" itemprop="name">Zhao Qi</p>
<div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
<nav class="site-state">
<div class="site-state-item site-state-posts">
<a href="/archives/">
<span class="site-state-item-count">34</span>
<span class="site-state-item-name">日志</span>
</a>
</div>
<div class="site-state-item site-state-categories">
<a href="/categories/">
<span class="site-state-item-count">12</span>
<span class="site-state-item-name">分类</span></a>
</div>
<div class="site-state-item site-state-tags">
<a href="/tags/">
<span class="site-state-item-count">32</span>
<span class="site-state-item-name">标签</span></a>
</div>
</nav>
</div>
<div class="sidebar-button motion-element">
<a onclick="tidioChatApi.open();"><i class="fa fa-comment"></i>
Chat
</a>
</div>
<div class="links-of-author motion-element">
<span class="links-of-author-item">
<a href="https://github.com/ZhaoQi99" title="GitHub → https://github.com/ZhaoQi99" rel="noopener" target="_blank"><i class="fa fa-fw fa-github"></i>GitHub</a>
</span>
<span class="links-of-author-item">
<a href="mailto:956361916@qq.com" title="E-Mail → mailto:956361916@qq.com" rel="noopener" target="_blank"><i class="fa fa-fw fa-envelope"></i>E-Mail</a>
</span>
<span class="links-of-author-item">
<a href="http://blog.csdn.net/zaq0123" title="Csdn → http://blog.csdn.net/zaq0123" rel="noopener" target="_blank"><i class="fa fa-fw fa-crosshairs"></i>Csdn</a>
</span>
<span class="links-of-author-item">
<a href="tencent://AddContact/?fromId=45&fromSubId=1&subcmd=all&uin=956361916&website=www.oicqzone.com" title="QQ → tencent://AddContact/?fromId=45&fromSubId=1&subcmd=all&uin=956361916&website=www.oicqzone.com" rel="noopener" target="_blank"><i class="fa fa-fw fa-qq"></i>QQ</a>
</span>
</div>
</div>
<div class="back-to-top motion-element">
<i class="fa fa-arrow-up"></i>
<span>0%</span>
</div>
</div>
</aside>
<div id="sidebar-dimmer"></div>
</div>
</main>
<footer class="footer">
<div class="footer-inner">
<div class="copyright">
©
<span itemprop="copyrightYear">2021</span>
<span class="with-love">
<i class="fa fa-heart"></i>
</span>
<span class="author" itemprop="copyrightHolder">Zhao Qi</span>
<span class="post-meta-divider">|</span>
<span class="post-meta-item-icon">
<i class="fa fa-area-chart"></i>
</span>
<span class="post-meta-item-text">站点总字数:</span>
<span title="站点总字数">121k</span>
<span class="post-meta-divider">|</span>
<span class="post-meta-item-icon">
<i class="fa fa-coffee"></i>
</span>
<span class="post-meta-item-text">站点阅读时长 ≈</span>
<span title="站点阅读时长">3:22</span>
</div>
<div class="addthis_inline_share_toolbox">
<script src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5a73dc9a89a291e2" async="async"></script>
</div>
<div class="busuanzi-count">
<script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
<span class="post-meta-item-icon">
<i class="fa fa-user"></i>
</span>
<span class="site-uv" title="总访客量">
<span id="busuanzi_value_site_uv"></span>
</span>
</span>
<span class="post-meta-divider">|</span>
<span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
<span class="post-meta-item-icon">
<i class="fa fa-eye"></i>
</span>
<span class="site-pv" title="总访问量">
<span id="busuanzi_value_site_pv"></span>
</span>
</span>
</div>
<script>
function leancloudSelector(url) {
url = encodeURI(url);
return document.getElementById(url).querySelector('.leancloud-visitors-count');
}
if (CONFIG.page.isPost) {
function addCount(Counter) {
var visitors = document.querySelector('.leancloud_visitors');
var url = decodeURI(visitors.getAttribute('id'));
var title = visitors.getAttribute('data-flag-title');
Counter('get', `/classes/Counter?where=${JSON.stringify({ url })}`)
.then(response => response.json())
.then(({ results }) => {
if (results.length > 0) {
var counter = results[0];
Counter('put', '/classes/Counter/' + counter.objectId, { time: { '__op': 'Increment', 'amount': 1 } })
.then(response => response.json())
.then(() => {
leancloudSelector(url).innerText = counter.time + 1;
})
.catch(error => {
console.error('Failed to save visitor count', error);
})
} else {
Counter('post', '/classes/Counter', { title: title, url: url, time: 1 })
.then(response => response.json())
.then(() => {
leancloudSelector(url).innerText = 1;
})
.catch(error => {
console.error('Failed to create', error);
});
}
})
.catch(error => {
console.error('LeanCloud Counter Error', error);
});
}
} else {
function showTime(Counter) {
var visitors = document.querySelectorAll('.leancloud_visitors');
var entries = [...visitors].map(element => {
return decodeURI(element.getAttribute('id'));
});
Counter('get', `/classes/Counter?where=${JSON.stringify({ url: { '$in': entries } })}`)
.then(response => response.json())
.then(({ results }) => {
if (results.length === 0) {
document.querySelectorAll('.leancloud_visitors .leancloud-visitors-count').forEach(element => {
element.innerText = 0;
});
return;
}
for (let item of results) {
let { url, time } = item;
leancloudSelector(url).innerText = time;
}
for (let url of entries) {
var element = leancloudSelector(url);
if (element.innerText == '') {
element.innerText = 0;
}
}
})
.catch(error => {
console.error('LeanCloud Counter Error', error);
});
}
}
fetch('https://app-router.leancloud.cn/2/route?appId=MnBX1GBcBpr93IXE9uTeMyDu-MdYXbMMI')
.then(response => response.json())
.then(({ api_server }) => {
var Counter = (method, url, data) => {
return fetch(`https://${api_server}/1.1${url}`, {
method: method,
headers: {
'X-LC-Id': 'MnBX1GBcBpr93IXE9uTeMyDu-MdYXbMMI',
'X-LC-Key': 'RpflrtuNUofuownICaX6FXW9',
'Content-Type': 'application/json',
},
body: JSON.stringify(data)
});
};
if (CONFIG.page.isPost) {
if (CONFIG.hostname !== location.hostname) return;
addCount(Counter);
} else if (document.querySelectorAll('.post-title-link').length >= 1) {
showTime(Counter);
}
});
</script>
</div>
</footer>
</div>
<script color='0,0,255' opacity='0.5' zIndex='-1' count='99' src="//cdn.jsdelivr.net/gh/theme-next/theme-next-canvas-nest@1/canvas-nest.min.js"></script>
<script size="300" alpha="0.6" zIndex="-1" src="//cdn.jsdelivr.net/gh/theme-next/theme-next-canvas-ribbon@1/canvas-ribbon.js"></script>
<script src="//cdn.jsdelivr.net/npm/animejs@3.1.0/lib/anime.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/lozad@1/dist/lozad.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/velocity-animate@1/velocity.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/velocity-animate@1/velocity.ui.min.js"></script>
<script src="/js/utils.js"></script><script src="/js/motion.js"></script>
<script src="/js/schemes/pisces.js"></script>
<script src="/js/next-boot.js"></script><script src="/js/bookmark.js"></script>
<script defer src="//cdn.jsdelivr.net/gh/theme-next/theme-next-three@1/three.min.js"></script>
<script defer src="//cdn.jsdelivr.net/gh/theme-next/theme-next-three@1/three-waves.min.js"></script>
<script defer src="//cdn.jsdelivr.net/gh/theme-next/theme-next-three@1/canvas_lines.min.js"></script>
<script defer src="//cdn.jsdelivr.net/gh/theme-next/theme-next-three@1/canvas_sphere.min.js"></script>
<script>
(function(){
var bp = document.createElement('script');
var curProtocol = window.location.protocol.split(':')[0];
bp.src = (curProtocol === 'https') ? 'https://zz.bdstatic.com/linksubmit/push.js' : 'http://push.zhanzhang.baidu.com/push.js';
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(bp, s);
})();
</script>
<script src="/js/local-search.js"></script>
<script src="//code.tidio.co/b79ynkhsb79sau11luajewp1xtr4os3z.js"></script>
<script>
if (document.querySelectorAll('div.pdf').length) {
NexT.utils.getScript('//cdn.jsdelivr.net/npm/pdfobject@2/pdfobject.min.js', () => {
document.querySelectorAll('div.pdf').forEach(element => {
PDFObject.embed(element.getAttribute('target'), element, {
pdfOpenParams: {
navpanes: 0,
toolbar: 0,
statusbar: 0,
pagemode: 'thumbs',
view: 'FitH'
},
PDFJS_URL: '/lib/pdf/web/viewer.html',
height: element.getAttribute('height') || '700px'
});
});
}, window.PDFObject);
}
</script>
<script src="//cdn.jsdelivr.net/npm/quicklink@1/dist/quicklink.umd.js"></script>
<script>
window.addEventListener('load', () => {
quicklink({
timeout: 3000,
priority: true,
ignores: [uri => uri.includes('#'),uri => uri == 'https://zhaoqi.vip/18543.html',]
});
});
</script>
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css">
<script>
NexT.utils.loadComments(document.querySelector('#gitalk-container'), () => {
NexT.utils.getScript('//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js', () => {
var gitalk = new Gitalk({
clientID: '2bfc8024a0d12e3688e6',
clientSecret: 'fcc20711a99e233437dd403c8ef7066c57c0259d',
repo: 'zhaoqi99.github.io',
owner: 'ZhaoQi99',
admin: ['ZhaoQi99'],
id: location.pathname ,
language: 'zh-CN',
distractionFreeMode: true,
proxy: 'https://cors.zhaoqi.workers.dev/corsproxy/?apiUrl=https://github.com/login/oauth/access_token',
});
gitalk.render('gitalk-container');
}, window.Gitalk);
});
</script>
</body>
</html>