{
  "id": "nextjs/invalid-image-optimization-url-protocol",
  "signature": "Error: Image optimization for URL '...' failed because the protocol is not allowed. Only 'https:' is supported.",
  "signature_zh": "错误：URL '...' 的图像优化失败，因为协议不被允许。仅支持 'https:'。",
  "regex": "Error: Image optimization for URL '.*' failed because the protocol is not allowed\\. Only 'https:' is supported\\.",
  "domain": "nextjs",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The next/image component or Image API is trying to optimize an image with an http:// URL, but Next.js only allows https:// URLs by default for security reasons.",
  "root_cause_type": "generic",
  "root_cause_zh": "next/image 组件或 Image API 尝试使用 http:// URL 优化图像，但出于安全原因，Next.js 默认只允许 https:// URL。",
  "versions": [
    {
      "version": "next@13.5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "next@14.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "next@14.2.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "If the image server does not support https, the image will not load.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This removes all optimization benefits and may increase page load times.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The protocol check is separate from the hostname check; you need to explicitly allow http.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Add the dangerousAllowingHttp option to next.config.js to allow http:// URLs. Use with caution.",
      "success_rate": 0.9,
      "how": "Add the dangerousAllowingHttp option to next.config.js to allow http:// URLs. Use with caution.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If you control the image source, migrate to https:// using a CDN or SSL certificate.",
      "success_rate": 0.95,
      "how": "If you control the image source, migrate to https:// using a CDN or SSL certificate.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a proxy or rewrite in next.config.js to serve http images through an https endpoint.",
      "success_rate": 0.8,
      "how": "Use a proxy or rewrite in next.config.js to serve http images through an https endpoint.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "在 next.config.js 中添加 dangerousAllowingHttp 选项以允许 http:// URL。请谨慎使用。",
    "如果您控制图像源，请使用 CDN 或 SSL 证书迁移到 https://。",
    "在 next.config.js 中使用代理或重写，通过 https 端点提供 http 图像。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://nextjs.org/docs/messages/invalid-image-optimization-url-protocol",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.88,
  "resolvable": "true",
  "first_seen": "2024-01-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}