Bump CACHEBUST to v8 for backend and frontend rebuilds; update Nginx and NostrAuthGuard to handle X-Forwarded-Prefix for NIP-98 compliance

This commit is contained in:
Dorian
2026-02-13 20:20:32 +00:00
parent dea2d2e768
commit abb83fe164
5 changed files with 27 additions and 10 deletions

View File

@@ -88,9 +88,15 @@ export class NostrAuthGuard extends AuthGuard('nostr') {
'http';
const host =
request.get('host') ?? request.headers.host ?? request.hostname;
// When behind a reverse proxy that strips a path prefix (e.g. /api),
// the proxy should forward X-Forwarded-Prefix so we can reconstruct
// the original URL that the client signed in its NIP-98 event.
const prefix =
(request.headers['x-forwarded-prefix'] as string | undefined) ?? '';
const path = request.originalUrl ?? request.url ?? '';
return `${protocolHeader}://${host}${path}`;
return `${protocolHeader}://${host}${prefix}${path}`;
}
private mapErrorToHttpException(error: NostrAuthError) {