-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathnext.config.ts
More file actions
75 lines (73 loc) · 2.27 KB
/
Copy pathnext.config.ts
File metadata and controls
75 lines (73 loc) · 2.27 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
63
64
65
66
67
68
69
70
71
72
73
74
75
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
output: "standalone",
// Next.js 16 blocks cross-origin requests to /_next/* dev resources
// (HMR, source maps, dev assets) by default. When the dev server is
// accessed via a non-localhost address — Tailscale, LAN IPs, etc. —
// this prevents the page from hydrating and breaks all interactivity.
// Allowlist the hosts/IPs we actually use during development.
allowedDevOrigins: [
"100.81.232.33", // tailscale
"10.195.102.16", // lan
"localhost",
],
async redirects() {
return [
{
// www serves the same pages on a second hostname, doubling crawl budget.
source: "/:path*",
has: [{ type: "host", value: "www.seqout.org" }],
destination: "https://seqout.org/:path*",
permanent: true,
},
];
},
async rewrites() {
// Proxy to localhost:8000 during local development
// In production, /api routes are handled by the deployed backend
if (process.env.NODE_ENV === "development") {
return [
{
source: "/api/:path*",
destination: "http://localhost:8000/:path*",
},
];
}
return [];
},
async headers() {
return [
{
source: "/:path*",
headers: [
{
key: "Strict-Transport-Security",
value: "max-age=31536000; includeSubDomains",
},
{
key: "Referrer-Policy",
value: "strict-origin-when-cross-origin",
},
{
key: "Permissions-Policy",
value: "camera=(), microphone=(), geolocation=(), browsing-topics=()",
},
{
key: "Content-Security-Policy-Report-Only",
value: [
"default-src 'self'",
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://www.googletagmanager.com https://www.google-analytics.com",
"style-src 'self' 'unsafe-inline'",
"img-src 'self' data: blob: https:",
"font-src 'self' data:",
"connect-src 'self' https:",
"worker-src 'self' blob:",
"frame-ancestors 'none'",
].join("; "),
},
],
},
];
},
};
export default nextConfig;