
sineware/static-proxySineware Static HTTP Proxy是一个生成网站本地静态副本并提供服务的工具。它通过向客户端提供受控的静态版本,保护Wordpress等动态后端免受直接***,减少直接暴露风险。
适用于需要保护动态网站后端(如Wordpress)的场景,尤其适合:
以下环境变量用于配置代理服务:
bashAPI_KEY=abc123 # 访问/sw-api/refresh端点的API密钥(在Authorization头中使用"Bearer <token>"格式) UPSTREAM_URL="https://sineware.ca" # 后端服务的公开/应用配置URL UPSTREAM_INTERNAL_URL="" # 可选,指定Static Proxy访问上游服务的内部URL(如绕过负载均衡器) UPSTREAM_POST_URL="" # 接收POST请求JSON转发的目标URL HOST_URL="http://localhost:3000" # 静态服务器的托管URL WHITELIST_PATHS="" # 可选,逗号分隔的允许路由路径(仅允许这些路径) BLACKLIST_PATHS="/wp-admin,/wp-login,/xmlrpc" # 逗号分隔的禁止路由路径
所有POST请求(包括URL编码和请求体)会被捕获且不直接传递至后端。若配置了UPSTREAM_POST_URL,请求会被转换为JSON格式转发至该URL;若未配置,则POST请求将被忽略。
服务器首次请求时会下载上游内容并缓存。后续请求将直接提供缓存内容,不再访问上游。当上游内容更新时,需通过以下方式刷新缓存:
/sw-api/refresh端点Authorization: Bearer <API_KEY>(其中<API_KEY>为配置的环境变量值)bashdocker run -d \ -p 3000:3000 \ -e API_KEY="your_secure_api_key" \ -e UPSTREAM_URL="https://your-wordpress-site.com" \ -e HOST_URL="https://static.your-domain.com" \ -e BLACKLIST_PATHS="/wp-admin,/wp-login,/xmlrpc,/admin" \ -e UPSTREAM_POST_URL="https://your-backend.com/api/receive-post" \ sineware/static-proxy
Copyright (C) 2023 Seshan Ravikumar This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <[***]>.


探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务