Browse Source

Docsify Auto Published

willin 7 years ago
parent
commit
abd3d91f5d
3 changed files with 78 additions and 0 deletions
  1. 2 0
      _sidebar.md
  2. 34 0
      basic/knowledge/fonts.md
  3. 42 0
      experience/operation/cloudflare-nginx.md

+ 2 - 0
_sidebar.md

@@ -17,6 +17,7 @@
     - [GIT](basic/knowledge/git.md)
     - [Promise](basic/knowledge/promise.md)
     - [Docker 加速](basic/knowledge/docker.md)
+    - [Web中文字体](basic/knowledge/fonts.md)
   - Vanilla JS
     - [小技巧](basic/js/tricks.md)
     - [Fetch AJAX](basic/js/fetch.md)
@@ -77,6 +78,7 @@
     - [重启服务](experience/operation/restarter.md)
     - [版本回退](experience/operation/rollback.md)
     - [CertBot证书](experience/operation/certbot.md)
+    - [CloudFlare](experience/operation/cloudflare-nginx.md)
   - Azure(Node.js)
     - [IoT Hub](experience/azure/iot-hub.md)
     - [Storage](experience/azure/storage.md)

+ 34 - 0
basic/knowledge/fonts.md

@@ -0,0 +1,34 @@
+# 跨平台的Web中文字体解决方案
+
+Fonts.css: <http://zenozeng.github.io/fonts.css/>
+
+## 黑体
+
+```css
+font-family: -apple-system, "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans CN", "Source Han Sans SC", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif;
+```
+
+- Use apple system font (like San Francisco) by default, see also: https://github.com/zenozeng/fonts.css/issues/29
+- 某些 Linux 中 Helvetica 会自动 fallback 到 Nimbus Sans L (具体见 /etc/fonts/conf.d/30-metric-aliases.conf, debian jessie/sid )
+- 某些 Linux 中 Arial 会自动 fallback 到 Liberation Sans (具体见 /etc/fonts/conf.d/30-metric-aliases.conf, debian jessie/sid )
+
+## 楷体
+
+```css
+font-family: Baskerville, Georgia, "Liberation Serif", "Kaiti SC", STKaiti, "AR PL UKai CN", "AR PL UKai HK", "AR PL UKai TW", "AR PL UKai TW MBE", "AR PL KaitiM GB", KaiTi, KaiTi_GB2312, DFKai-SB, "TW\-Kai", serif;
+```
+
+## 宋体
+
+```css
+font-family: Georgia, "Nimbus Roman No9 L", "Songti SC", STSong, "AR PL New Sung", "AR PL SungtiL GB", NSimSun, SimSun, "TW\-Sung", "WenQuanYi Bitmap Song", "AR PL UMing CN", "AR PL UMing HK", "AR PL UMing TW", "AR PL UMing TW MBE", PMingLiU, MingLiU, serif;
+```
+
+## 仿宋
+
+```css
+font-family: Baskerville, "Times New Roman", "Liberation Serif", STFangsong, FangSong, FangSong_GB2312, "CWTEX\-F", serif;
+```
+
+- 某些 Linux 中 Times New Roman 会自动 fallback 到 Liberation Serif (具体见 /etc/fonts/conf.d/30-metric-aliases.conf, debian jessie/sid )
+- CWTEX仿宋体是繁体字型

+ 42 - 0
experience/operation/cloudflare-nginx.md

@@ -0,0 +1,42 @@
+# CloudFlare Nginx 获取真实ip地址
+
+## 配置
+
+安装 `ngx_http_realip_module` 模块, 在 `nginx.conf` 中进行配置:
+
+```conf
+set_real_ip_from 103.21.244.0/22; 
+set_real_ip_from 103.22.200.0/22; 
+set_real_ip_from 103.31.4.0/22; 
+set_real_ip_from 104.16.0.0/12; 
+set_real_ip_from 108.162.192.0/18; 
+set_real_ip_from 131.0.72.0/22; 
+set_real_ip_from 141.101.64.0/18; 
+set_real_ip_from 162.158.0.0/15; 
+set_real_ip_from 172.64.0.0/13; 
+set_real_ip_from 173.245.48.0/20; 
+set_real_ip_from 188.114.96.0/20; 
+set_real_ip_from 190.93.240.0/20; 
+set_real_ip_from 197.234.240.0/22; 
+set_real_ip_from 198.41.128.0/17; 
+set_real_ip_from 199.27.128.0/21; 
+set_real_ip_from 2400:cb00 :: / 32; 
+set_real_ip_from 2606:4700 :: / 32; 
+set_real_ip_from 2803:f800 :: / 32; 
+set_real_ip_from 2405:b500 :: / 32; 
+set_real_ip_from 2405:8100 :: / 32; 
+set_real_ip_from 2c0f:f248 :: / 32; 
+set_real_ip_from 2a06:98c0 :: / 29; 
+
+# 使用以下任意一个
+# real_ip_header CF-Connecting-IP; 
+# 推荐这个
+real_ip_header X-Forwarded-For;
+```
+
+从这个网址获取IP列表的更新: <https://www.cloudflare.com/ips/>
+
+## 参考资料
+
+- Nginx模块`ngx_http_realip_module`: <http://nginx.org/en/docs/http/ngx_http_realip_module.html>
+- CloudFlare 原始访客ip: <https://support.cloudflare.com/hc/en-us/articles/200170706-How-do-I-restore-original-visitor-IP-with-Nginx->