Repository: next.js
Issue: `next.config.js` rewrites `destination` key does not handle special characters
Labels: bug,Navigation,linear: next

### Verify canary release

- [X] I verified that the issue exists in Next.js canary release

### Provide environment information

    Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 21.3.0: Wed Jan  5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000
    Binaries:
      Node: 16.13.1
      npm: 8.1.2
      Yarn: 1.22.17
      pnpm: 6.11.0
    Relevant packages:
      next: 12.1.1-canary.15
      react: 17.0.2
      react-dom: 17.0.2

### What browser are you using? (if relevant)

_No response_

### How are you deploying your application? (if relevant)

_No response_

### Describe the Bug

I want to add a `rewrites` in `next.config.js`:

```
  async rewrites() {
    return [
      {
        source: "/\\+\\+api\\+\\+/:slug*",
        destination: "http://localhost:8080/Plone/++api++/:slug*",
      },
    ];
  },
```

but Next throws:

```
Server Error
TypeError: Unexpected MODIFIER at 7, expected END

This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
mustConsume
file:///Users/sneridagh/Development/plone/voltonext/node_modules/next/dist/compiled/path-to-regexp/index.js (113:15)
parse
file:///Users/sneridagh/Development/plone/voltonext/node_modules/next/dist/compiled/path-to-regexp/index.js (172:9)
stringToRegexp
file:///Users/sneridagh/Development/plone/voltonext/node_modules/next/dist/compiled/path-to-regexp/index.js (329:27)
Object.pathToRegexp
file:///Users/sneridagh/Development/plone/voltonext/node_modules/next/dist/compiled/path-to-regexp/index.js (403:12)
Object.prepareDestination
file:///Users/sneridagh/Development/plone/voltonext/node_modules/next/dist/shared/lib/router/utils/prepare-destination.js (105:24)
Object.fn
file:///Users/sneridagh/Development/plone/voltonext/node_modules/next/dist/server/next-server.js (634:90)
Router.execute
file:///Users/sneridagh/Development/plone/voltonext/node_modules/next/dist/server/router.js (233:48)
async DevServer.run
file:///Users/sneridagh/Development/plone/voltonext/node_modules/next/dist/server/base-server.js (582:29)
async DevServer.run
file:///Users/sneridagh/Development/plone/voltonext/node_modules/next/dist/server/dev/next-dev-server.js (444:20)
async DevServer.handleRequest
file:///Users/sneridagh/Development/plone/voltonext/node_modules/next/dist/server/base-server.js (297:20)
```

I already tried adding the scape sequence, somehow in source it does work, while in destination does not:

```
  async rewrites() {
    return [
      {
        source: "/\\+\\+api\\+\\+/:slug*",
        destination: "http://localhost:8080/Plone/\\+\\+api\\+\\+/:slug*",
      },
    ];
  },
```

### Expected Behavior

The rewrite goes through without problems.

### To Reproduce

```/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  async rewrites() {
    return [
      {
        source: "/\\+\\+api\\+\\+/:slug*",
        destination: "http://localhost:8080/Plone/\\+\\+api\\+\\+/:slug*",
      },
    ];
  },
};

module.exports = nextConfig;
```