fix(next): remove middleware/redirects and disable trailingSlash to avoid loop; rely on Nginx redirect
All checks were successful
build-and-push-ext / build_push (push) Successful in 4m39s
All checks were successful
build-and-push-ext / build_push (push) Successful in 4m39s
This commit is contained in:
parent
a3793512c2
commit
c4207cfd3a
@ -1,18 +1 @@
|
|||||||
import { NextResponse } from 'next/server';
|
// Disabled: trailing slash handled by Nginx
|
||||||
import type { NextRequest } from 'next/server';
|
|
||||||
|
|
||||||
export function middleware(request: NextRequest) {
|
|
||||||
const { pathname } = request.nextUrl;
|
|
||||||
if (pathname === '/lecoffre') {
|
|
||||||
const url = request.nextUrl.clone();
|
|
||||||
url.pathname = '/lecoffre/';
|
|
||||||
return NextResponse.redirect(url, 308);
|
|
||||||
}
|
|
||||||
return NextResponse.next();
|
|
||||||
}
|
|
||||||
|
|
||||||
export const config = {
|
|
||||||
matcher: ['/lecoffre'],
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,17 +5,7 @@ const nextConfig = {
|
|||||||
output: 'standalone',
|
output: 'standalone',
|
||||||
basePath: '/lecoffre',
|
basePath: '/lecoffre',
|
||||||
assetPrefix: '/lecoffre',
|
assetPrefix: '/lecoffre',
|
||||||
trailingSlash: true,
|
trailingSlash: false,
|
||||||
async redirects() {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
source: '/lecoffre',
|
|
||||||
destination: '/lecoffre/',
|
|
||||||
permanent: false,
|
|
||||||
// basePath applies by default
|
|
||||||
},
|
|
||||||
];
|
|
||||||
},
|
|
||||||
typescript: {
|
typescript: {
|
||||||
ignoreBuildErrors: true,
|
ignoreBuildErrors: true,
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user