Skip to content

Commit

Permalink
Launch two fastcgi allocs
Browse files Browse the repository at this point in the history
  • Loading branch information
lens0021 committed Oct 12, 2024
1 parent 1b33f18 commit d354b53
Show file tree
Hide file tree
Showing 5 changed files with 385 additions and 50 deletions.
121 changes: 73 additions & 48 deletions caddy/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,58 +8,83 @@
# NOTE: See @filter for the further details
order respond before rewrite
}
femiwiki.com *.femiwiki.com 127.0.0.1:80 localhost:80
tls {
dns route53
}
root * /srv/femiwiki.com
php_fastcgi {$FASTCGI_ADDR}
file_server
encode gzip
mwcache {
ristretto {
num_counters 30000
max_cost 10000
buffer_items 64
femiwiki.com *.femiwiki.com 127.0.0.1:80 localhost:80 {
tls {
dns route53
}
purge_acl {
10.0.0.0/8
127.0.0.1
root * /srv/femiwiki.com
php_fastcgi {$FASTCGI_ADDR}
file_server
encode gzip
mwcache {
ristretto {
num_counters 30000
max_cost 10000
buffer_items 64
}
purge_acl {
10.0.0.0/8
127.0.0.1
}
}
header {
# HSTS
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
# Enable XSS filtering for legacy browsers
X-XSS-Protection "1; mode=block"
# Block content sniffing, and enable Cross-Origin Read Blocking
X-Content-Type-Options "nosniff"
# Avoid clickjacking
X-Frame-Options "DENY"
}
}
header {
# HSTS
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
# Enable XSS filtering for legacy browsers
X-XSS-Protection "1; mode=block"
# Block content sniffing, and enable Cross-Origin Read Blocking
X-Content-Type-Options "nosniff"
# Avoid clickjacking
X-Frame-Options "DENY"
}

rewrite /w/api.php /api.php
rewrite /w/* /index.php
rewrite /w/api.php /api.php
rewrite /w/* /index.php

# Ignore malformed requests
@filter0 {
path /w/특수:내언어/페미위키:대문
vars_regexp {query} ^=[0-9]{1,5}$
}
@filter1 {
path /
vars_regexp {query} ^[A-Z]{5}=[A-Z]{3}$
}
@filter2 {
header User-Agent *ClaudeBot*
}
# Ignore malformed requests
@filter0 {
path /w/특수:내언어/페미위키:대문
vars_regexp {query} ^=[0-9]{1,5}$
}
@filter1 {
path /
vars_regexp {query} ^[A-Z]{5}=[A-Z]{3}$
}
@filter2 {
header User-Agent *ClaudeBot*
}

respond @filter0 200 {
close
}
respond @filter1 200 {
close
respond @filter0 200 {
close
}
respond @filter1 200 {
close
}
respond @filter2 200 {
close
}
}
respond @filter2 200 {
close

test.femiwiki.com {
tls {
dns route53
}
root * /srv/femiwiki.com
php_fastcgi {$FASTCGI_BLUE_ADDR}
file_server
encode gzip

header {
# HSTS
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
# Enable XSS filtering for legacy browsers
X-XSS-Protection "1; mode=block"
# Block content sniffing, and enable Cross-Origin Read Blocking
X-Content-Type-Options "nosniff"
# Avoid clickjacking
X-Frame-Options "DENY"
}

rewrite /w/api.php /api.php
rewrite /w/* /index.php
}
Loading

0 comments on commit d354b53

Please sign in to comment.