https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png

| user www-data; | |
| http { | |
| ## | |
| # Basic Settings | |
| ## | |
| sendfile on; | |
| tcp_nopush on; |
| const net = require('net') | |
| net.createServer(client => { | |
| client.once('data', data => { | |
| client.write(Buffer.from([5, 0])); | |
| client.once('data', data => { | |
| data = [...data]; | |
| let ver = data.shift(); | |
| let cmd = data.shift(); //1: connect, 2: bind, 3: udp | |
| let rsv = data.shift(); |
| server { | |
| server_name default_server; | |
| # This is for Let's Encrypt certification renewal | |
| include /etc/nginx/snippets/letsencrypt.conf; | |
| # Redirect to https | |
| location / { | |
| return 301 https://$server_name$request_uri; | |
| } | |
| } |
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
| #!/bin/bash | |
| hash git 2>/dev/null || { echo >&2 "Required command 'git' is not installed. ( hmm... why are you using this? ) Aborting."; exit 1; } | |
| hash realpath 2>/dev/null || { echo >&2 "Required command 'realpath' is not installed. Aborting."; exit 1; } | |
| hash pwd 2>/dev/null || { echo >&2 "Required command 'pwd' is not installed. Aborting."; exit 1; } | |
| hash cd 2>/dev/null || { echo >&2 "Required command 'cd' is not installed. Aborting."; exit 1; } | |
| hash echo 2>/dev/null || { echo >&2 "Required command 'echo' is not installed. Aborting."; exit 1; } | |
| hash mv 2>/dev/null || { echo >&2 "Required command 'mv' is not installed. Aborting."; exit 1; } | |
| hash diff 2>/dev/null || { echo >&2 "Required command 'diff' is not installed. Aborting."; exit 1; } | |
| hash diffstat 2>/dev/null || { echo >&2 "Required command 'diffstat' is not installed. Aborting."; exit 1; } |