doc: update docker.md & linux-command.md & nginx.md (#838)
* doc: update linux-command.md * 增加代理构建 * 删除上次提交多余
This commit is contained in:
		@@ -163,6 +163,7 @@ $ docker build - < Dockerfile
 | 
				
			|||||||
$ docker build - < context.tar.gz
 | 
					$ docker build - < context.tar.gz
 | 
				
			||||||
$ docker build -t eon/nginx-server .
 | 
					$ docker build -t eon/nginx-server .
 | 
				
			||||||
$ docker build -f myOtherDockerfile .
 | 
					$ docker build -f myOtherDockerfile .
 | 
				
			||||||
 | 
					$ docker build --build-arg https_proxy=127.0.0.1:8088 # 使用http代理构建
 | 
				
			||||||
$ curl example.com/remote/Dockerfile | docker build -f - .
 | 
					$ curl example.com/remote/Dockerfile | docker build -f - .
 | 
				
			||||||
$ docker save -o <保存路径>/myimage.tar myimage:latest # 导出
 | 
					$ docker save -o <保存路径>/myimage.tar myimage:latest # 导出
 | 
				
			||||||
$ docker load -i <路径>/myimage.tar # 导入
 | 
					$ docker load -i <路径>/myimage.tar # 导入
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,6 +24,7 @@ Linux 命令速查表
 | 
				
			|||||||
**`w`** | 显示系统中当前登录的用户
 | 
					**`w`** | 显示系统中当前登录的用户
 | 
				
			||||||
**`whoami`** | 显示您的登录身份
 | 
					**`whoami`** | 显示您的登录身份
 | 
				
			||||||
**`finger username`** | 显示有关用户的信息
 | 
					**`finger username`** | 显示有关用户的信息
 | 
				
			||||||
 | 
					**`sed -ri 's/.*swap.*/#&/' /etc/fstab && swapoff -a`** | 关闭swap
 | 
				
			||||||
<!--rehype:className=style-list-->
 | 
					<!--rehype:className=style-list-->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### 硬件
 | 
					### 硬件
 | 
				
			||||||
@@ -332,6 +333,23 @@ Linux 命令速查表
 | 
				
			|||||||
`Ctrl`+`N` (Down) | 下一条命令
 | 
					`Ctrl`+`N` (Down) | 下一条命令
 | 
				
			||||||
<!--rehype:className=left-align shortcuts-->
 | 
					<!--rehype:className=left-align shortcuts-->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					技巧
 | 
				
			||||||
 | 
					---
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### linux技巧
 | 
				
			||||||
 | 
					<!--rehype:wrap-class=row-span-2 col-span-2-->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 :---                                          | :---
 | 
				
			||||||
 | 
					:----------------------------------------------| :---
 | 
				
			||||||
 | 
					 **`du -h / \| sort -rh \| head -20`**         | 最大20个文件
 | 
				
			||||||
 | 
					 **`grep -Ev '^\s*($\|#\|;)' example.conf`**   | 查看去掉注释和空行
 | 
				
			||||||
 | 
					 **`echo <passwd> \| passwd root --stdin`**    | 单行改密码
 | 
				
			||||||
 | 
					 **`find /data/app/tmp -mtime +30 -name "*.flv" -exec rm -Rf {} \;`**  | 删除30天前文件
 | 
				
			||||||
 | 
					 **`for file in $(ls); do sed -i 's/nmg/sz/g' "$file"; done`**         | 当前目录修改字符串
 | 
				
			||||||
 | 
					 **`ssh -NfR remote_port:localhost:local_port user@remote_server`**    | ssh代理
 | 
				
			||||||
 | 
					 **`find . -wholename "*.sh" -exec dos2unix {} \;`**     | 修复脚本格式错误
 | 
				
			||||||
 | 
					 <!--rehype:className=left-align shortcuts-->  
 | 
				
			||||||
 | 
					
 | 
				
			||||||
另见
 | 
					另见
 | 
				
			||||||
---
 | 
					---
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -975,44 +975,6 @@ server {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### 流量镜像配置
 | 
					 | 
				
			||||||
<!--rehype:wrap-class=col-span-3-->
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
```nginx
 | 
					 | 
				
			||||||
server {
 | 
					 | 
				
			||||||
    listen       80;
 | 
					 | 
				
			||||||
    server_name 192.168.1.1;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    location = /mirror1 {
 | 
					 | 
				
			||||||
        internal;
 | 
					 | 
				
			||||||
        #### address1 ####
 | 
					 | 
				
			||||||
        proxy_set_header Host mirror1.com;
 | 
					 | 
				
			||||||
        proxy_pass http://127.0.0.1:8008/api/service/list;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    location = /mirror2 {
 | 
					 | 
				
			||||||
        internal;
 | 
					 | 
				
			||||||
        #### address2 ####
 | 
					 | 
				
			||||||
        proxy_set_header Host mirror2.com;
 | 
					 | 
				
			||||||
        proxy_pass http://127.0.0.1:8009/api/service/list;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # 只转发这个接口
 | 
					 | 
				
			||||||
    location /api/service/list {
 | 
					 | 
				
			||||||
        access_log /data/logs/nginx/json_test_to_mirror.log json;
 | 
					 | 
				
			||||||
        mirror /mirror1;
 | 
					 | 
				
			||||||
        mirror /mirror2;
 | 
					 | 
				
			||||||
        proxy_pass http://127.0.0.1:8007;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    location / {
 | 
					 | 
				
			||||||
        access_log /data/logs/nginx/json_test.log json;
 | 
					 | 
				
			||||||
        proxy_pass http://192.168.1.1:8007;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
```
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
另见
 | 
					另见
 | 
				
			||||||
---
 | 
					---
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user