feat: Proxy Umami analytics script and API calls through Next.js rewrites.
This commit is contained in:
@@ -25,8 +25,9 @@ export default function RootLayout({
|
|||||||
<head>
|
<head>
|
||||||
<Script
|
<Script
|
||||||
defer
|
defer
|
||||||
src="https://umami.mati.ss/script.js"
|
src="/stats/script.js"
|
||||||
data-website-id="40b6b47d-9d1f-47ff-91cf-151c98637945"
|
data-website-id="40b6b47d-9d1f-47ff-91cf-151c98637945"
|
||||||
|
data-host-url="/stats"
|
||||||
strategy="afterInteractive"
|
strategy="afterInteractive"
|
||||||
/>
|
/>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -2,6 +2,13 @@ import type { NextConfig } from "next";
|
|||||||
|
|
||||||
const nextConfig: NextConfig = {
|
const nextConfig: NextConfig = {
|
||||||
output: "standalone",
|
output: "standalone",
|
||||||
|
async rewrites() {
|
||||||
|
return [
|
||||||
|
{ source: "/stats/script.js", destination: "https://umami.mati.ss/script.js" },
|
||||||
|
{ source: "/stats/api/send", destination: "https://umami.mati.ss/api/send" },
|
||||||
|
{ source: "/stats/api/collect", destination: "https://umami.mati.ss/api/collect" },
|
||||||
|
];
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default nextConfig;
|
export default nextConfig;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user