Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5006163ddf | |||
| 35fb31249a | |||
| 120ba0488c |
@@ -104,7 +104,7 @@ layout: "fullBleed"
|
||||
icon: "hdd",
|
||||
lists: [
|
||||
[
|
||||
"Horizontalspülbohrverfahren (bis 250m)",
|
||||
"Horizontalspülbohrverfahren (bis 400m)",
|
||||
"Horizontalspülbohrverfahren (bis 400er Rohr)",
|
||||
"Erdrakete (bis 15m DÖ-Länge)",
|
||||
"Erdrakete (bis 160er Rohr)"
|
||||
|
||||
@@ -104,7 +104,7 @@ layout: "fullBleed"
|
||||
icon: "hdd",
|
||||
lists: [
|
||||
[
|
||||
"Horizontal directional drilling (up to 250m)",
|
||||
"Horizontal directional drilling (up to 400m)",
|
||||
"Horizontal directional drilling (up to 400mm pipe)",
|
||||
"Earth rocket (up to 15m crossing length)",
|
||||
"Earth rocket (up to 160mm pipe)"
|
||||
|
||||
@@ -27,7 +27,8 @@ services:
|
||||
- "traefik.http.routers.${PROJECT_NAME:-klz}.middlewares=${AUTH_MIDDLEWARE:-etib-ratelimit,etib-forward,etib-compress}"
|
||||
|
||||
# Public Router – paths that bypass Gatekeeper auth (health, SEO, static assets, OG images)
|
||||
- "traefik.http.routers.${PROJECT_NAME:-klz}-public.rule=(${TRAEFIK_HOST_RULE:-Host(`${TRAEFIK_HOST:-e-tib.com}`) || Host(`staging.${TRAEFIK_HOST:-e-tib.com}`) || Host(`testing.${TRAEFIK_HOST:-e-tib.com}`)}) && PathRegexp(`^/([a-z]{2}/)?(health|login|gatekeeper|uploads|media|assets|robots\\.txt|manifest\\.webmanifest|sitemap(-[0-9]+)?\\.xml|(.*/)?api/og(/.*)?|(.*/)?opengraph-image.*)`)"
|
||||
- "traefik.http.routers.${PROJECT_NAME:-klz}-public.rule=(${TRAEFIK_HOST_RULE:-Host(`${TRAEFIK_HOST:-e-tib.com}`) || Host(`staging.${TRAEFIK_HOST:-e-tib.com}`) || Host(`testing.${TRAEFIK_HOST:-e-tib.com}`)}) && PathRegexp(`^/([a-z]{2}/)?(health|login|gatekeeper|uploads|media|assets|_next|robots\\.txt|manifest\\.webmanifest|sitemap(-[0-9]+)?\\.xml|(.*/)?api/og(/.*)?|(.*/)?opengraph-image.*)`)"
|
||||
|
||||
- "traefik.http.routers.${PROJECT_NAME:-klz}-public.entrypoints=${TRAEFIK_ENTRYPOINT:-web}"
|
||||
- "traefik.http.routers.${PROJECT_NAME:-klz}-public.tls.certresolver=${TRAEFIK_CERT_RESOLVER:-}"
|
||||
- "traefik.http.routers.${PROJECT_NAME:-klz}-public.tls=${TRAEFIK_TLS:-false}"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "e-tib-nextjs",
|
||||
"version": "2.4.54",
|
||||
"version": "2.4.57",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"packageManager": "pnpm@10.18.3",
|
||||
|
||||
11
proxy.ts
11
proxy.ts
@@ -7,11 +7,12 @@ export default createMiddleware({
|
||||
});
|
||||
|
||||
export const config = {
|
||||
// Match all pathnames except for
|
||||
// Match all pathnames except for:
|
||||
// - /api (API routes)
|
||||
// - /stats (Analytics proxy)
|
||||
// - /_next (Next.js internals)
|
||||
// - /_static (inside /public)
|
||||
// - all root files inside /public (e.g. /favicon.ico)
|
||||
matcher: ['/((?!api|stats|_next|assets|_static|_vercel|[\\w-]+\\.\\w+).*)']
|
||||
// - /_next (Next.js internals & image optimizer)
|
||||
// - /assets, /_static (static files in /public)
|
||||
// - all files with an extension (e.g. /favicon.ico, .JPG, .png, .webp, .svg)
|
||||
matcher: ['/((?!api|stats|_next|assets|_static|_vercel|.*\\..*).*)']
|
||||
};
|
||||
|
||||
|
||||
21
tests/proxy-config.test.ts
Normal file
21
tests/proxy-config.test.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { config } from '../proxy';
|
||||
|
||||
describe('Proxy Middleware Config Matcher', () => {
|
||||
const matcherRegex = new RegExp(`^${config.matcher[0]}`);
|
||||
|
||||
|
||||
it('matches localized page routes for next-intl processing', () => {
|
||||
expect(matcherRegex.test('/de')).toBe(true);
|
||||
expect(matcherRegex.test('/en/contact')).toBe(true);
|
||||
expect(matcherRegex.test('/karriere')).toBe(true);
|
||||
});
|
||||
|
||||
it('excludes static assets with any file extension including uppercase .JPG and subdirectories', () => {
|
||||
// These should NOT match the middleware (expect test to be false so middleware is bypassed)
|
||||
expect(matcherRegex.test('/assets/photos/DJI_0048.JPG')).toBe(false);
|
||||
expect(matcherRegex.test('/assets/videos/web/hero-kabelpflug-poster.jpg')).toBe(false);
|
||||
expect(matcherRegex.test('/assets/logo-white.png')).toBe(false);
|
||||
expect(matcherRegex.test('/_next/image')).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user