Move admin dashboard to admin.myhoneydue.com subdomain
- Remove Next.js basePath "/admin" — admin now serves at root - Update all internal links from /admin/xxx to /xxx - Change Go proxy to host-based routing: admin subdomain requests proxy to Next.js, /admin/* redirects to main web app - Update timeout middleware skipper for admin subdomain Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -73,7 +74,9 @@ func SetupRouter(deps *Dependencies) *echo.Echo {
|
||||
// timeout middleware wraps the response writer in *http.timeoutWriter
|
||||
// which does not implement http.Flusher, causing a panic when
|
||||
// httputil.ReverseProxy or WebSocket upgraders try to flush.
|
||||
return strings.HasPrefix(path, "/admin") ||
|
||||
// Also skip for admin subdomain (all requests proxied to Next.js).
|
||||
adminHost := os.Getenv("ADMIN_HOST")
|
||||
return (adminHost != "" && c.Request().Host == adminHost) ||
|
||||
strings.HasPrefix(path, "/_next") ||
|
||||
strings.HasSuffix(path, "/ws")
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user