хозяйственная работа: временно позволите доступ, загружаются чайница
This commit is contained in:
parent
da1b6c270a
commit
ca39330df5
2 changed files with 47 additions and 36 deletions
|
|
@ -1,50 +1,60 @@
|
||||||
{
|
{
|
||||||
cache
|
cache
|
||||||
log {
|
|
||||||
format console
|
log {
|
||||||
level WARN
|
level INFO
|
||||||
}
|
format transform `{request>client_ip} - {user_id} [{ts}] "{request>method} {request>uri} {request>proto}" {status} {size} "{request>headers>Referer>[0]}" "{request>headers>User-Agent>[0]}"` {
|
||||||
|
time_format "02/Jan/2006: 15:04:05 -0700"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
servers :80 {
|
||||||
|
trusted_proxies static private_ranges
|
||||||
|
client_ip_headers X-Forwarded-For X-Real-IP
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
http://ядро.орг, http://*.ядро.орг {
|
http://ядро.орг, http://*.ядро.орг {
|
||||||
tls internal
|
tls internal
|
||||||
encode gzip zstd
|
encode gzip zstd
|
||||||
|
|
||||||
cache {
|
log
|
||||||
# we don't want to flood the upstream from the same IP
|
|
||||||
mode bypass
|
|
||||||
ttl 30m
|
|
||||||
|
|
||||||
timeout {
|
cache {
|
||||||
backend 10m
|
# we don't want to flood the upstream from the same IP
|
||||||
}
|
mode bypass
|
||||||
}
|
ttl 30m
|
||||||
|
|
||||||
import Caddyfile.yadro proxy:80
|
timeout {
|
||||||
|
backend 10m
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
import Caddyfile.yadro proxy:80
|
||||||
}
|
}
|
||||||
|
|
||||||
:9000 {
|
:9000 {
|
||||||
reverse_proxy {
|
reverse_proxy {
|
||||||
dynamic a puppy 80
|
dynamic a puppy 80
|
||||||
lb_policy least_conn
|
lb_policy least_conn
|
||||||
|
|
||||||
transport http {
|
transport http {
|
||||||
response_header_timeout 10m
|
response_header_timeout 10m
|
||||||
read_timeout 10m
|
read_timeout 10m
|
||||||
write_timeout 10m
|
write_timeout 10m
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cache {
|
cache {
|
||||||
allowed_http_verbs POST
|
allowed_http_verbs POST
|
||||||
ttl 7d
|
ttl 7d
|
||||||
|
|
||||||
key {
|
key {
|
||||||
headers X-Translation-Direction
|
headers X-Translation-Direction
|
||||||
}
|
}
|
||||||
|
|
||||||
timeout {
|
timeout {
|
||||||
backend 10m
|
backend 10m
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
FROM caddy:builder AS builder
|
FROM caddy:builder AS builder
|
||||||
RUN --mount=type=cache,target=/go/pkg/mod xcaddy build \
|
RUN --mount=type=cache,target=/go/pkg/mod xcaddy build \
|
||||||
--with github.com/caddyserver/cache-handler
|
--with github.com/caddyserver/cache-handler \
|
||||||
|
--with github.com/caddyserver/transform-encoder
|
||||||
|
|
||||||
FROM caddy:latest
|
FROM caddy:latest
|
||||||
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
|
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue