[优化] 自定义不存在页面返回状态码

This commit is contained in:
ryan
2026-06-02 08:14:15 +08:00
parent d21643feed
commit 3825a7f29a
10 changed files with 196 additions and 110 deletions
@@ -1193,8 +1193,8 @@ func TestRenderConfigUsesDefaultServerFallback(t *testing.T) {
if !strings.Contains(preview.MainConfig, "server_name _;") {
t.Fatal("expected preview main config to include default server_name")
}
if !strings.Contains(preview.MainConfig, "return 404;") {
t.Fatal("expected preview main config to return 404 for unmatched hosts")
if !strings.Contains(preview.MainConfig, "return 421;") {
t.Fatal("expected preview main config to return 421 for unmatched hosts")
}
if !strings.Contains(preview.MainConfig, "ssl_reject_handshake on;") {
t.Fatal("expected preview main config to reject unmatched https handshakes")