mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 16:21:11 +08:00
Remove Caddyfile
This commit is contained in:
parent
5626cd1eb0
commit
112c0e3320
3 changed files with 0 additions and 304 deletions
|
|
@ -1,102 +0,0 @@
|
||||||
{
|
|
||||||
debug
|
|
||||||
http_port 80
|
|
||||||
https_port 443
|
|
||||||
order cache before rewrite
|
|
||||||
cache {
|
|
||||||
cache_name GHProxyCache
|
|
||||||
}
|
|
||||||
log {
|
|
||||||
level INFO
|
|
||||||
output file /data/caddy/log/caddy.log {
|
|
||||||
roll_size 5MB
|
|
||||||
roll_keep 10
|
|
||||||
}
|
|
||||||
}
|
|
||||||
servers :80 {
|
|
||||||
protocols h1 h2c
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
(log) {
|
|
||||||
log {
|
|
||||||
format transform `{request>headers>X-Forwarded-For>[0]:request>remote_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"
|
|
||||||
}
|
|
||||||
output file /data/caddy/log/{args[0]}/access.log {
|
|
||||||
roll_size 5MB
|
|
||||||
roll_keep 10
|
|
||||||
roll_keep_for 24h
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
(error_page) {
|
|
||||||
handle_errors {
|
|
||||||
rewrite * /{err.status_code}.html
|
|
||||||
root * /data/caddy/pages/errors
|
|
||||||
file_server
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
(encode) {
|
|
||||||
encode {
|
|
||||||
zstd best
|
|
||||||
br 5 v2
|
|
||||||
gzip 5
|
|
||||||
minimum_length 512
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
(cache) {
|
|
||||||
cache {
|
|
||||||
allowed_http_verbs GET
|
|
||||||
stale {args[0]}
|
|
||||||
ttl {args[1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
(header_realip) {
|
|
||||||
header_up X-Real-IP {remote_host}
|
|
||||||
header_up X-Real-IP {http.request.header.CF-Connecting-IP}
|
|
||||||
header_up X-Forwarded-For {http.request.header.CF-Connecting-IP}
|
|
||||||
header_up X-Forwarded-Proto {http.request.header.CF-Visitor}
|
|
||||||
}
|
|
||||||
|
|
||||||
(rate_limit) {
|
|
||||||
route /* {
|
|
||||||
rate_limit {remote.ip} {args[0]}r/m 10000 429
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
:80 {
|
|
||||||
reverse_proxy {
|
|
||||||
to 127.0.0.1:8080
|
|
||||||
import header_realip
|
|
||||||
transport http {
|
|
||||||
versions 1.1 h2c
|
|
||||||
}
|
|
||||||
}
|
|
||||||
import log ghproxy
|
|
||||||
import cache 0s 300s
|
|
||||||
import error_page
|
|
||||||
import encode
|
|
||||||
import rate_limit 60
|
|
||||||
route / {
|
|
||||||
root /data/www
|
|
||||||
file_server
|
|
||||||
import cache 0s 24h
|
|
||||||
}
|
|
||||||
route /favicon.ico {
|
|
||||||
root /data/www
|
|
||||||
file_server
|
|
||||||
import cache 0s 24h
|
|
||||||
}
|
|
||||||
|
|
||||||
route /api* {
|
|
||||||
rate_limit {remote.ip} 15r/m 10000 429
|
|
||||||
import cache 0s 6h
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
import /data/caddy/config.d/*
|
|
||||||
|
|
@ -1,99 +0,0 @@
|
||||||
{
|
|
||||||
debug
|
|
||||||
http_port 80
|
|
||||||
https_port 443
|
|
||||||
order cache before rewrite
|
|
||||||
cache {
|
|
||||||
cache_name GHProxyCache
|
|
||||||
}
|
|
||||||
log {
|
|
||||||
level INFO
|
|
||||||
output file /data/caddy/log/caddy.log {
|
|
||||||
roll_size 5MB
|
|
||||||
roll_keep 10
|
|
||||||
}
|
|
||||||
}
|
|
||||||
servers :80 {
|
|
||||||
protocols h1 h2c
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
(log) {
|
|
||||||
log {
|
|
||||||
format transform `{request>headers>X-Forwarded-For>[0]:request>remote_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"
|
|
||||||
}
|
|
||||||
output file /data/caddy/log/{args[0]}/access.log {
|
|
||||||
roll_size 5MB
|
|
||||||
roll_keep 10
|
|
||||||
roll_keep_for 24h
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
(error_page) {
|
|
||||||
handle_errors {
|
|
||||||
rewrite * /{err.status_code}.html
|
|
||||||
root * /data/caddy/pages/errors
|
|
||||||
file_server
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
(encode) {
|
|
||||||
encode {
|
|
||||||
zstd best
|
|
||||||
br 5 v2
|
|
||||||
gzip 5
|
|
||||||
minimum_length 256
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
(cache) {
|
|
||||||
cache {
|
|
||||||
allowed_http_verbs GET
|
|
||||||
stale {args[0]}
|
|
||||||
ttl {args[1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
(header_realip) {
|
|
||||||
header_up X-Real-IP {remote_host}
|
|
||||||
header_up X-Real-IP {http.request.header.CF-Connecting-IP}
|
|
||||||
header_up X-Forwarded-For {http.request.header.CF-Connecting-IP}
|
|
||||||
header_up X-Forwarded-Proto {http.request.header.CF-Visitor}
|
|
||||||
}
|
|
||||||
|
|
||||||
(rate_limit) {
|
|
||||||
route /* {
|
|
||||||
rate_limit {remote.ip} {args[0]}r/m 10000 429
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
:80 {
|
|
||||||
reverse_proxy {
|
|
||||||
to h2c://127.0.0.1:8080
|
|
||||||
import header_realip
|
|
||||||
}
|
|
||||||
import log ghproxy
|
|
||||||
import error_page
|
|
||||||
import encode
|
|
||||||
import rate_limit 60
|
|
||||||
route / {
|
|
||||||
root /data/www
|
|
||||||
file_server
|
|
||||||
import cache 300s
|
|
||||||
}
|
|
||||||
route /favicon.ico {
|
|
||||||
root /data/www
|
|
||||||
file_server
|
|
||||||
import cache 300s
|
|
||||||
}
|
|
||||||
|
|
||||||
route /api* {
|
|
||||||
rate_limit {remote.ip} 15r/m 10000 429
|
|
||||||
import cache 300s
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
import /data/caddy/config.d/*
|
|
||||||
|
|
@ -1,103 +0,0 @@
|
||||||
{
|
|
||||||
debug
|
|
||||||
http_port 80
|
|
||||||
https_port 443
|
|
||||||
order cache before rewrite
|
|
||||||
cache {
|
|
||||||
cache_name GHProxyCache
|
|
||||||
}
|
|
||||||
log {
|
|
||||||
level INFO
|
|
||||||
output file /data/caddy/log/caddy.log {
|
|
||||||
roll_size 5MB
|
|
||||||
roll_keep 10
|
|
||||||
}
|
|
||||||
}
|
|
||||||
servers :80 {
|
|
||||||
protocols h1 h2c
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
(log) {
|
|
||||||
log {
|
|
||||||
format transform `{request>headers>X-Forwarded-For>[0]:request>remote_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"
|
|
||||||
}
|
|
||||||
output file /data/caddy/log/{args[0]}/access.log {
|
|
||||||
roll_size 5MB
|
|
||||||
roll_keep 10
|
|
||||||
roll_keep_for 24h
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
(error_page) {
|
|
||||||
handle_errors {
|
|
||||||
rewrite * /{err.status_code}.html
|
|
||||||
root * /data/caddy/pages/errors
|
|
||||||
file_server
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
(encode) {
|
|
||||||
encode {
|
|
||||||
zstd best
|
|
||||||
br 5 v2
|
|
||||||
gzip 5
|
|
||||||
minimum_length 512
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
(cache) {
|
|
||||||
cache {
|
|
||||||
allowed_http_verbs GET
|
|
||||||
stale {args[0]}
|
|
||||||
ttl {args[1]}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
(header_realip) {
|
|
||||||
header_up X-Real-IP {remote_host}
|
|
||||||
header_up X-Real-IP {http.request.header.CF-Connecting-IP}
|
|
||||||
header_up X-Forwarded-For {http.request.header.CF-Connecting-IP}
|
|
||||||
header_up X-Forwarded-Proto {http.request.header.CF-Visitor}
|
|
||||||
}
|
|
||||||
|
|
||||||
(rate_limit) {
|
|
||||||
route /* {
|
|
||||||
rate_limit {remote.ip} {args[0]}r/m 10000 429
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
:80 {
|
|
||||||
reverse_proxy {
|
|
||||||
to 127.0.0.1:8080
|
|
||||||
import header_realip
|
|
||||||
transport http {
|
|
||||||
versions 1.1 h2c
|
|
||||||
}
|
|
||||||
}
|
|
||||||
import log ghproxy
|
|
||||||
import cache 0s 300s
|
|
||||||
import error_page
|
|
||||||
import encode
|
|
||||||
import rate_limit 60
|
|
||||||
route / {
|
|
||||||
root /data/www
|
|
||||||
file_server
|
|
||||||
import cache 0s 24h
|
|
||||||
}
|
|
||||||
route /favicon.ico {
|
|
||||||
root /data/www
|
|
||||||
file_server
|
|
||||||
import cache 0s 24h
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
route /api* {
|
|
||||||
rate_limit {remote.ip} 15r/m 10000 429
|
|
||||||
import cache 0s 6h
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
import /data/caddy/config.d/*
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue