大家拿去用,机子都是无线流量
https://docker.melikeme.cn/
一键设置镜像加速脚本(自带安装docker):
curl -s https://docker.melikeme.cn/docker.sh -o docker.sh && chmod +x docker.sh && ./docker.sh
放个Nginx反代配置文件
# ------------------------------------------------------------
# docker1.melikeme.cn
# ------------------------------------------------------------
server {
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name docker.melikeme.cn;
root /etc/nginx/sites/docker.melikeme.cn;
index index.html;
# Custom SSL
ssl_certificate /etc/nginx/ssl/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/privkey.pem;
ssl_session_timeout 1d;
ssl_protocols TLSv1.2 TLSv1.3; # 去除TLSv1.1
#resolver 1.1.1.1 8.8.8.8 valid=300s; # 确保配置DNS解析器
resolver_timeout 5s;
location / {
try_files $uri $uri/ /index.html;
}
# 提供 docker.sh 文件
location = /docker.sh {
allow all;
default_type text/plain;
}
# 用于 Docker 代理服务
location ^~ /v2/ {
proxy_pass https://registry-1.docker.io;
proxy_set_header Host registry-1.docker.io;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
proxy_request_buffering off;
proxy_http_version 1.1;
proxy_read_timeout 18000s;
proxy_send_timeout 18000s;
send_timeout 18000s;
proxy_connect_timeout 18000s;
proxy_set_header Authorization $http_authorization; # 确保传递正确的Authorization头部
proxy_pass_header Authorization;
proxy_intercept_errors on;
recursive_error_pages on;
error_page 301 302 307 = @handle_redirect;
}
# 用于处理重定向
location @handle_redirect {
#resolver 1.1.1.1; # DNS解析器
set $saved_redirect_location '$upstream_http_location';
proxy_pass $saved_redirect_location;
}
}