Reverse proxy

Hi,
I have a problem because I have an application hosted by vercel, and it works perfectly, a simple application. I would like to connect my vercel application to another application via reverse proxy but not to the main path but to some route, for example www.myApp.com/vercelApp and currently if I go to this path, i.e. www.myApp.com/vercelApp the main page of the vercel application appears correctly the problem is when I want to change the route then I get 308 and redirect and I am immediately transferred to route: www.myApp.com/new and I should be on route: 应用宝官网-全网最新最热手机应用游戏下载 and here is the problem because I spent many hours on it and I was not able to solve it. I checked many different next.config configurations and manipulated rewrites as well as skipTrailingSlashRedirect but nothing works, it seems to me that this redirect happens before reaching rewrites if someone knows how to help me I would be grateful

Thanks

Hello and welcome, @tjcodebiuro-gmailcom! There are a couple of guides that can help you get this working.

unfortunately none of the solutions solve my problem

If you can share the configuration, someone here might be able to recognize if anything needs to be modified

next.config.js = module.exports = {
  skipTrailingSlashRedirect: true,
  assetPrefix: 'https://fw-gielda.vercel.app',
  async rewrites() {
    return [
      {
        source: "/:path*",
        destination: "/gielda/:path*"
      }  
    ];
  },
  headers: async () => [
    {
      source: "/:all*(.png|.jpg|.jpeg|.gif|.svg)",
      headers: [
        {
          key: "Cache-Control",
          value: "public, max-age=31536000, must-revalidate",
        },
      ],
    },
  ],
  modularizeImports: {
    '@mui/material': {
      transform: '@mui/material/{{member}}',
    },
    '@mui/lab': {
      transform: '@mui/lab/{{member}}',
    },
  },
  webpack(config) {
    config.module.rules.push({
      test: /\.(mp3)$/,
      use: [
        {
          loader: 'file-loader',
          options: {
            name: 'static/media/[name].[ext]',
          },
        },
      ],
    });
    config.module.rules.push({
      test: /\.svg$/,
      use: ['@svgr/webpack'],
    });
    return config;
  },
};

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.