DNS 解析修改指向 服务器源 IP
修改 caddy 配置文件
> /etc/caddy/Caddyfile
:80
{
redir https://域名{uri}
gzip
}
https://域名
{
tls /etc/caddy/my.crt /etc/caddy/my.key {
ca /etc/caddy/ca.crt
}
gzip {
not /sync /ct /js /css
}
timeouts none
basicauth "root" passwd1 {
realm "Mary Lou's documents"
/ct
}
proxy / https://npm.taobao.org {
except /mirrors /ct /js /css /sync /template /api
}
header / {
X-Frame-Options "SAMEORIGIN"
X-XSS-Protection "1; mode=block"
X-Content-Type-Options "nosniff"
Referrer-Policy "no-referrer-when-downgrade"
Content-Security-Policy "default-src * data: 'unsafe-eval' 'unsafe-inline'"
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
}
header /sync {
Cache-Control "no-cache"
Content-Type "text/event-stream"
}
header /ct {
Connection ""
X-Accel-Buffering "no"
}
header /sync {
Connection ""
X-Accel-Buffering "no"
}
proxy /ct 127.0.0.1:3001 {
without /ct
websocket
transparent
header_upstream X-Real-IP {remote}
header_upstream X-Forwarded-Server {host}
header_upstream X-Forwarded-Host {host}
}
proxy /api 127.0.0.1:3001 {
websocket
transparent
header_upstream X-Real-IP {remote}
header_upstream X-Forwarded-Server {host}
header_upstream X-Forwarded-Host {host}
}
proxy /js 127.0.0.1:3001 {
websocket
transparent
}
proxy /template 127.0.0.1:3001 {
header_upstream X-Real-IP {remote}
header_upstream X-Forwarded-Server {host}
header_upstream X-Forwarded-Host {host}
websocket
transparent
}
proxy /css 127.0.0.1:3001 {
header_upstream X-Real-IP {remote}
header_upstream X-Forwarded-Server {host}
header_upstream X-Forwarded-Host {host}
websocket
transparent
}
proxy /sync 127.0.0.1:3001 {
header_upstream X-Real-IP {remote}
header_upstream X-Forwarded-Server {host}
header_upstream X-Forwarded-Host {host}
transparent
websocket
}
}
import sites/*
增加SSL证书
SSL 证书使用 cloudflare 生成的
使用 yummpy ftp pro 远程增删改