Skip to content
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
8 changes: 8 additions & 0 deletions caddy/WebCaddyfile.internal
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@
file_server
}

# --- Serve /.well-known (security.txt, RFC 9116) without SPA fallback ---
handle /.well-known/* {
root * /usr/share/caddy
encode zstd gzip
header Cache-Control "public, max-age=86400"
file_server
}

# --- Optional: force SEO view for humans via ?__seo=1 ---
@force_seo expression `{query}.matches("(^|&)(__seo=1)($|&)")`
handle @force_seo {
Expand Down
8 changes: 8 additions & 0 deletions caddy/WebCaddyfile.local
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@
file_server
}

# --- Serve /.well-known (security.txt, RFC 9116) without SPA fallback ---
handle /.well-known/* {
root * /usr/share/caddy
encode zstd gzip
header Cache-Control "public, max-age=86400"
file_server
}

# --- Serve SPA (simple) ---
handle @spa {
root * /usr/share/caddy
Expand Down
4 changes: 4 additions & 0 deletions public/.well-known/security.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Contact: mailto:gustavoocanto@gmail.com
Expires: 2027-06-05T00:00:00.000Z
Preferred-Languages: en
Canonical: https://oullin.io/.well-known/security.txt
3 changes: 3 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
User-agent: *
Allow: /
Disallow: /seo
4 changes: 4 additions & 0 deletions tests/caddy/web-caddyfile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,8 @@ describe('production web Caddy relay contract', () => {

expect(relayExclusions.length).toBeGreaterThanOrEqual(2);
});

it('serves /.well-known (security.txt) as static files without SPA fallback', () => {
expect(caddyfile).toMatch(/handle \/\.well-known\/\*\s*{[^}]*root \* \/usr\/share\/caddy[^}]*file_server[^}]*}/s);
});
});
Loading