/images/avatar-home.jpeg

Docker 容器之间通信方法

DOcker:新的联网功能允许您按容器的名称连接到容器,因此,如果创建一个新网络,则连接到该网络的任何容器都可以通过其名称访问其他容器。:

1)创建新网络

 docker network create <network-name>

2)将容器连接到网络

docker run --net=<network-name> ...

或者将已存在容器加入新的网络

docker network connect <network-name> <container-name>

 

3)按名称ping容器

docker exec -ti <container-name-A> ping <container-name-B>

Ps:需要注意的是,如果容器没有指定名称(–name),那么就只能用id。

verynginx安装教程

VeryNginx

VeryNginx 是一个功能强大而对人类友好的 Nginx 扩展程序.可作为cc、waf防火墙使用。

介绍

VeryNginx 基于 lua_nginx_module(openrestry) 开发,实现了高级的防火墙、访问统计和其他的一些功能。 集成在 Nginx 中运行,扩展了 Nginx 本身的功能,并提供了友好的 Web 交互界面。 VeryNginx在线实例 用户名 / 密码: verynginx / verynginx 详细配置说明见:VeryNginx Github WiKi

Nginx 运行状态分析

  • 每秒请求数
  • 响应时间
  • 网络流量
  • 网络连接数

https://camo.githubusercontent.com/6a1c4358a36f5242e54dbfd03312a766e151ddb2/687474703a2f2f7777322e73696e61696d672e636e2f6d773639302f33666364306564336a7731663137656e376f6331796a32307a30306f6c30776c2e6a7067

自定义行为

VeryNginx 包含强大的自定义功能,可以做很多事情 自定义行为包含两部分, Matcher 和 Action 。 Matcher 用来对请求进行匹配, Action 为要执行的动作 这样的优势在于把所有的前置判断整合在Matcher里一起来实现了,使复杂(组合)规则的实现变成了可能

Matcher

一个 Matcher 用来判断一个 Http 请求是否符合指定的条件, 一个 Matcher 可以包含一个或者多个约束条件,目前支持以下几种约束:

chevereto nginx rewrite 规则

网上看了几篇规则倒是可以,但是我的用户名是admin,和后台管理界面冲突了,显示404。以下是官方的rewrite。

#Chevereto: Disable access to sensitive files
location ~* /(app|content|lib)/.*\.(po|php|lock|sql)$ {
    deny all;
}
#Chevereto: CORS headers
location ~* /.*\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js) {
    add_header Access-Control-Allow-Origin "*";
}
#Chevereto: Upload path for image content only and set 404 replacement
location ^~ /images/ {
    location ~* (jpe?g|png|gif) {
        log_not_found off;
        error_page 404 /content/images/system/default/404.gif;
    }
    return 403;
}
#Chevereto: Pretty URLs
location / {
    index index.php;
    try_files $uri $uri/ /index.php?$query_string;
}

In case you installed Chevereto in a sub folder, the rules should look like this(如果您将Chevereto安装在子文件夹中,则规则应如下所示:):

KS10 基础测试

----------------------------------------------------------------------
 Superbench.sh -- https://www.oldking.net/350.html
 Mode  : Standard    Version : 1.1.6
 Usage : wget -qO- git.io/superbench.sh | bash
----------------------------------------------------------------------
 CPU Model            : Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz
 CPU Cores            : 4 Cores 1599.951 MHz x86_64
 CPU Cache            : 6144 KB
 OS                   : Debian GNU/Linux 9 (64 Bit) Dedicated
 Kernel               : 4.9.0-11-amd64
 Total Space          : 1.7 GB / 1843.7 GB
 Total RAM            : 297 MB / 15950 MB (1219 MB Buff)
 Total SWAP           : 0 MB / 1022 MB
 Uptime               : 1 days 1 hour 25 min
 Load Average         : 0.21, 0.05, 0.02
 TCP CC               : bbr
 ASN & ISP            : AS16276, OVH ISP
 Organization         : OVH SAS
 Location             : Roubaix, France / FR
 Region               : Hauts-de-France
----------------------------------------------------------------------
 I/O Speed( 1.0GB )   : 146 MB/s
 I/O Speed( 1.0GB )   : 149 MB/s
 I/O Speed( 1.0GB )   : 145 MB/s
 Average I/O Speed    : 146.7 MB/s
----------------------------------------------------------------------
 Node Name        Upload Speed      Download Speed      Latency
 Speedtest.net    97.05 Mbit/s      92.86 Mbit/s        15.055 ms
 Fast.com         0.00 Mbit/s       53.2 Mbit/s         -
 Beijing 5G   CT  12.62 Mbit/s      8.84 Mbit/s         -
 Nanjing 5G   CT  9.84 Mbit/s       6.91 Mbit/s         -
 Hefei 5G     CT  8.43 Mbit/s       9.82 Mbit/s         -
 Guangzhou 5G CT  3.13 Mbit/s       1.16 Mbit/s         -
 TianJin 5G   CU  19.46 Mbit/s      5.04 Mbit/s         -
 Shanghai 5G  CU  3.47 Mbit/s       4.01 Mbit/s         -
 Guangzhou 5G CU  3.33 Mbit/s       3.10 Mbit/s         -
 Tianjin 5G   CM  13.29 Mbit/s      28.92 Mbit/s        -
 Wuxi 5G      CM  2.79 Mbit/s       4.29 Mbit/s         -
 Nanjing 5G   CM  5.69 Mbit/s       4.19 Mbit/s         -
 Changsha 5G  CM  8.95 Mbit/s       9.28 Mbit/s         -
----------------------------------------------------------------------
 Finished in  : 6 min 10 sec
 Timestamp    : 2019-12-28 17:24:31 GMT+8
 Results      : /root/superbench.log
----------------------------------------------------------------------
 Share result:
 · http://www.speedtest.net/result/8894357995.png
 · https://paste.ubuntu.com./p/wdfMqWt8KJ/
----------------------------------------------------------------------

KS7 基础测试

----------------------------------------------------------------------
 Superbench.sh -- https://www.oldking.net/350.html
 Mode  : Standard    Version : 1.1.6
 Usage : wget -qO- git.io/superbench.sh | bash
----------------------------------------------------------------------
 CPU Model            : Intel(R) Core(TM) i3-2130 CPU @ 3.40GHz
 CPU Cores            : 4 Cores 1672.115 MHz x86_64
 CPU Cache            : 3072 KB
 OS                   : CentOS 7.7.1908 (64 Bit) Dedicated
 Kernel               : 4.14.129-bbrplus
 Total Space          : 8.4 GB / 1843.2 GB
 Total RAM            : 1421 MB / 7875 MB (4847 MB Buff)
 Total SWAP           : 303 MB / 2046 MB
 Uptime               : 105 days 15 hour 1 min
 Load Average         : 0.20, 0.17, 0.11
 TCP CC               : bbrplus
 ASN & ISP            : AS16276, OVH SAS
 Organization         : OVH Hosting, Inc.
 Location             : Montreal, Canada / CA
 Region               : Quebec
----------------------------------------------------------------------
 I/O Speed( 1.0GB )   : 153 MB/s
 I/O Speed( 1.0GB )   : 154 MB/s
 I/O Speed( 1.0GB )   : 159 MB/s
 Average I/O Speed    : 155.3 MB/s
----------------------------------------------------------------------
 Node Name        Upload Speed      Download Speed      Latency
 Speedtest.net    97.26 Mbit/s      93.23 Mbit/s        6.052 ms
 Fast.com         0.00 Mbit/s       93.6 Mbit/s         -
 Beijing 5G   CT  9.32 Mbit/s       29.70 Mbit/s        -
 Nanjing 5G   CT  20.71 Mbit/s      29.61 Mbit/s        -
 Hefei 5G     CT  7.68 Mbit/s       21.46 Mbit/s        -
 Guangzhou 5G CT  0.85 Mbit/s       8.17 Mbit/s         -
 TianJin 5G   CU  13.29 Mbit/s      20.45 Mbit/s        -
 Shanghai 5G  CU  8.82 Mbit/s       23.73 Mbit/s        -
 Guangzhou 5G CU  10.23 Mbit/s      25.83 Mbit/s        -
 Tianjin 5G   CM  6.77 Mbit/s       13.90 Mbit/s        -
 Wuxi 5G      CM  3.50 Mbit/s       10.39 Mbit/s        -
 Nanjing 5G   CM  5.56 Mbit/s       17.93 Mbit/s        -
 Changsha 5G  CM  1.96 Mbit/s       47.78 Mbit/s        -
----------------------------------------------------------------------
 Finished in  : 7 min 4 sec
 Timestamp    : 2019-12-28 17:22:38 GMT+8
 Results      : /root/superbench.log
----------------------------------------------------------------------
 Share result:
 · http://www.speedtest.net/result/8894353677.png
 · https://paste.ubuntu.com./p/W5s7w5j9SB/
----------------------------------------------------------------------

ikoula 9.9欧特价机测试

----------------------------------------------------------------------
 Superbench.sh -- https://www.oldking.net/350.html
 Mode  : Standard    Version : 1.1.6
 Usage : wget -qO- git.io/superbench.sh | bash
----------------------------------------------------------------------
 CPU Model            : Intel(R) Celeron(R) CPU G3930 @ 2.90GHz
 CPU Cores            : 2 Cores 2900.132 MHz x86_64
 CPU Cache            : 2048 KB
 OS                   : CentOS 7.7.1908 (64 Bit) Dedicated
 Kernel               : 4.14.129-bbrplus
 Total Space          : 496.1 GB / 1844.2 GB
 Total RAM            : 857 MB / 7935 MB (5935 MB Buff)
 Total SWAP           : 196 MB / 1023 MB
 Uptime               : 120 days 20 hour 9 min
 Load Average         : 0.04, 0.06, 0.01
 TCP CC               : bbrplus
 ASN & ISP            : AS21409, Ikoula Ripe
 Organization         :
 Location             : Boulogne-Billancourt, France / FR
 Region               : Île-de-France
----------------------------------------------------------------------
 I/O Speed( 1.0GB )   : 177 MB/s
 I/O Speed( 1.0GB )   : 180 MB/s
 I/O Speed( 1.0GB )   : 186 MB/s
 Average I/O Speed    : 181.0 MB/s
----------------------------------------------------------------------
 Node Name        Upload Speed      Download Speed      Latency
 Speedtest.net    776.17 Mbit/s     865.04 Mbit/s       9.314 ms
 Fast.com         0.00 Mbit/s       154.9 Mbit/s        -
 Beijing 5G   CT  3.88 Mbit/s       58.06 Mbit/s        -
 Nanjing 5G   CT  7.71 Mbit/s       85.37 Mbit/s        -
 Hefei 5G     CT  4.14 Mbit/s       32.01 Mbit/s        -
 Guangzhou 5G CT  2.73 Mbit/s       19.70 Mbit/s        -
 TianJin 5G   CU  60.37 Mbit/s      89.34 Mbit/s        -
 Shanghai 5G  CU  3.52 Mbit/s       12.35 Mbit/s        -
 Guangzhou 5G CU  3.17 Mbit/s       20.52 Mbit/s        -
 Tianjin 5G   CM  12.40 Mbit/s      50.79 Mbit/s        -
 Wuxi 5G      CM  0.23 Mbit/s       0.19 Mbit/s         -
 Nanjing 5G   CM  5.03 Mbit/s       24.05 Mbit/s        -
 Changsha 5G  CM  9.78 Mbit/s       336.54 Mbit/s       -
----------------------------------------------------------------------
 Finished in  : 6 min 20 sec
 Timestamp    : 2019-12-28 17:16:02 GMT+8
 Results      : /root/superbench.log
----------------------------------------------------------------------
 Share result:
 · http://www.speedtest.net/result/8894341158.png
 · https://paste.ubuntu.com./p/fZ4YMRWsfz/
----------------------------------------------------------------------