-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathnext.config.ts
More file actions
62 lines (56 loc) · 1.58 KB
/
next.config.ts
File metadata and controls
62 lines (56 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
images: {
remotePatterns: [
{
protocol: "https",
hostname: "**",
port: "",
pathname: "/**",
},
],
},
async rewrites() {
const postHogBaseURL = process.env.NEXT_PUBLIC_POSTHOG_HOST;
if (!postHogBaseURL) {
return [];
}
const assetPath =
postHogBaseURL === "https://us.i.posthog.com"
? "https://us-assets.i.posthog.com"
: postHogBaseURL === "https://eu.i.posthog.com"
? "https://eu-assets.i.posthog.com"
: process.env.NEXT_PUBLIC_POSTHOG_ASSET_HOST || "";
return [
{
source: "/ingest/static/:path*",
destination: assetPath + "/static/:path*",
},
{
source: "/ingest/:path*",
destination: postHogBaseURL + "/:path*",
},
{
source: "/ingest/decide",
destination: postHogBaseURL + "/decide",
},
];
},
// async redirects() {
// return [
// {
// source: "/schedule",
// destination: "https://pycon-kenya-2025.sessionize.com/schedule",
// permanent: true, // Use true for 308 permanent redirect, false for 307 temporary
// },
// {
// source: "/speakers",
// destination: "https://pycon-kenya-2025.sessionize.com/speakers",
// permanent: true, // Use true for 308 permanent redirect, false for 307 temporary
// },
// ];
// },
// This is required to support PostHog trailing slash API requests
skipTrailingSlashRedirect: true,
};
export default nextConfig;