vercel.json Builder
Vercel Cloud Deployment & Edge Routing

Vercel構成ファイル (vercel.json) ビルダー

Build vercel.json configuration files with custom routing rewrites, redirects, headers, cleanUrls, trailingSlash, and cron job declarations.

Vercel V2 Schema Compliant
Zero Server Transmission
Presets:

Automatically strip .html extensions from page URLs

Enforce or redirect URLs ending with a trailing slash

{
  "$schema": "https://openapi.vercel.sh/vercel.json",
  "cleanUrls": true,
  "trailingSlash": false,
  "framework": "nextjs",
  "regions": [
    "iad1"
  ],
  "rewrites": [
    {
      "source": "/api/proxy/:path*",
      "destination": "https://backend-api.example.com/:path*"
    }
  ],
  "redirects": [
    {
      "source": "/old-blog/:slug",
      "destination": "/blog/:slug",
      "statusCode": 308
    }
  ],
  "headers": [
    {
      "source": "/(.*)",
      "headers": [
        {
          "key": "X-Content-Type-Options",
          "value": "nosniff"
        },
        {
          "key": "X-Frame-Options",
          "value": "DENY"
        },
        {
          "key": "Referrer-Policy",
          "value": "strict-origin-when-cross-origin"
        },
        {
          "key": "Strict-Transport-Security",
          "value": "max-age=63072000; includeSubDomains; preload"
        }
      ]
    }
  ],
  "crons": [
    {
      "path": "/api/cron/nightly-sync",
      "schedule": "0 4 * * *"
    }
  ],
  "functions": {
    "api/**/*.ts": {
      "runtime": "nodejs20.x",
      "memory": 1024,
      "maxDuration": 60
    }
  }
}
アクティブルーティング&Cron数
1 Rewrites•1 Redirects•1 Crons

リライト、リダイレクト、ヘッダー、関数、Cronの合計値。

デプロイ準備スコア
100 / 100•Production Ready

Vercel公式のルーティング規則およびタイムアウト制限に基づいて評価。

セキュリティ&キャッシュ設定状況
1 Header Blocks•Clean URLs ON

静的アセットおよびAPIルートに適用されたHTTPセキュリティヘッダー。

Zero-Knowledge Local Execution

All data processing, parsing, and compilation execute strictly inside your local browser memory. Zero external server uploads.

Sub-Millisecond AST Engine

All data payloads remain strictly local with zero external server communication.

Production Ready Export

Clean, optimized output formats ready for immediate deployment.

Technical Reference & Architecture Guide

Vercel.json Configuration & Architecture Cheatsheet — Reference Guide

Production-grade reference and schema builder guide for vercel.json, covering edge routing, rewrites, security headers, serverless runtimes, and crons.

Key Parameters & Controls

cleanUrlsboolean | null

Strips .html extensions from incoming request paths and redirects matching routes with 308 status codes.

Default: null
trailingSlashboolean | null

Enforces or removes trailing slashes globally across all routes via automated edge-level 308 redirects.

Default: null
rewritesRewriteRule[]

Array of internal proxy rules mapping source request patterns to destination endpoints without modifying the browser address bar.

Default: []
headersHeaderRule[]

HTTP response header injection rules matching glob or regex source paths for CSP, HSTS, and CORS policies.

Default: []
functionsFunctionRule[]

Per-pattern serverless function definitions specifying execution memory limits (128–3008 MB) and maximum execution duration.

Default: []
cronsCronRule[]

Array of automated background invocation schedules targeting API endpoints using standard 5-part POSIX UTC expressions.

Default: []

Pro Tips & Best Practices

Strict Regex Order in Rewrites

Place specific static and API proxy rewrites before catch-all wildcards (/(.*)). Vercel evaluates routing top-down and halts at the first matching rule.

Security Headers on Wildcards

Attach global headers like Strict-Transport-Security and X-Frame-Options to /((?!_next).*) to secure pages without overriding Next.js internal chunk caching.

Serverless Function Timeouts

Set maxDuration according to your plan tier (10s on Hobby, up to 300s on Pro/Enterprise) and configure memory to 1024 MB or higher for CPU-bound computations.

UTC Timezone for Cron Schedules

Always evaluate cron expressions against UTC. If triggering daily tasks at midnight EST, schedule the cron for 0 5 * * * to account for the standard 5-hour offset.

Common Gotchas & Troubleshooting

Infinite redirect loop with trailingSlash and custom redirects

Remove manual redirects that strip or append trailing slashes when trailingSlash: true or trailingSlash: false is configured, as Vercel edge nodes enforce 308 redirects automatically.

Cron job schedule fails schema validation with 6-value expressions

Vercel Cron triggers require standard 5-field POSIX cron syntax (* * * * *). Remove seconds fields or quartz expressions used in AWS or Spring environments.

Serverless function maxDuration exceeds Vercel plan quota

Hobby workspaces restrict maxDuration to 10 seconds. Reduce maxDuration to 10 or upgrade to a Pro workspace before deploying long-running background tasks.

Frequently Asked Questions

Does vercel.json override next.config.js redirects and rewrites?▼

Yes. Infrastructure rules defined in vercel.json are evaluated at the global edge network before requests reach the Next.js runtime routing layer.

Are configurations generated and validated entirely in local browser memory?▼

Yes. The builder parses, validates, and emits configuration artifacts client-side in memory without sending project details or secrets over the network.

How do server-side rewrites and HTTP redirects differ in vercel.json configuration?▼

Redirects return 301/302/307/308 HTTP status codes causing the client browser to change URLs, while rewrites proxy the backend destination transparently without modifying the URL in the address bar.

Can I deploy vercel.json cron jobs on the Vercel Hobby plan?▼

Yes, but Hobby deployments restrict crons to executing once every 24 hours. Sub-daily intervals (such as hourly or every 10 minutes) require a Pro or Enterprise plan.

Where should the generated vercel.json file be placed in a repository?▼

Place vercel.json at the root directory of your repository or monorepo project root, alongside package.json.

Related Tools & Utilities

All Tools →