S SmartDocs
시리즈: Ricky javascript 23 줄 · 업데이트 2026-04-14

next.config.js

Ricky/Cat Project Final/fp_fixed /next.config.js

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  async rewrites() {
    const origin = (
      process.env.BACKEND_INTERNAL_URL ||
      process.env.INTERNAL_API_URL ||
      "http://127.0.0.1:5050"
    ).replace(/\/$/, "");
    return [
      {
        source: "/api/uploads/:path*",
        destination: `${origin}/api/uploads/:path*`,
      },
      {
        source: "/uploads/:path*",
        destination: `${origin}/uploads/:path*`,
      },
    ];
  },
};

module.exports = nextConfig;

관련 글