Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Launch two fastcgi allocs #328

Merged
merged 3 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading