【问题标题】:How to make a reverse proxy with next.js如何使用 next.js 制作反向代理
【发布时间】:2021-08-08 20:13:32
【问题描述】:

我想使用 Next.js 为 GeForce NOW 网站创建一个反向代理,但我想不通。

module.exports = {
  async rewrites() {
    return [
      {
        source: '/:slug',
        destination: 'https://play.geforcenow.com/:slug',
      },
    ]
  },
}

这是我根据文档获得的,但它不起作用。

【问题讨论】:

    标签: javascript proxy next.js reverse-proxy


    【解决方案1】:

    我在 vercel.json 中使用它来工作:

    {
      "routes": [
        {
          "src": "(.*)",
          "dest": "https://play.geforcenow.com$1"
        }
      ]
    }
    

    【讨论】:

      猜你喜欢
      • 2020-05-02
      • 2015-02-09
      • 1970-01-01
      • 2017-03-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-15
      相关资源
      最近更新 更多