Skip to content

Commit

Permalink
Revert "Launch two fastcgi allocs (#328)"
Browse files Browse the repository at this point in the history
This reverts commit 2ed093f.
  • Loading branch information
lens0021 committed Oct 12, 2024
1 parent 2ed093f commit 16a7536
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 386 deletions.
121 changes: 48 additions & 73 deletions caddy/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,83 +8,58 @@
# 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
}
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"
}

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*
}

respond @filter0 200 {
close
}
respond @filter1 200 {
close
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
}
respond @filter2 200 {
close
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"
}

test.femiwiki.com {
tls {
dns route53
}
root * /srv/femiwiki.com
php_fastcgi {$FASTCGI_BLUE_ADDR}
file_server
encode gzip
rewrite /w/api.php /api.php
rewrite /w/* /index.php

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"
}
# 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*
}

rewrite /w/api.php /api.php
rewrite /w/* /index.php
respond @filter0 200 {
close
}
respond @filter1 200 {
close
}
respond @filter2 200 {
close
}
Loading

0 comments on commit 16a7536

Please sign in to comment.