Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
doc: mention reverse proxy and include simple example
  • Loading branch information
styfle committed Sep 4, 2025
commit 2d9d1afb9b93eb9f9598e9813e60dff7891c7c50
10 changes: 10 additions & 0 deletions doc/api/url.md
Original file line number Diff line number Diff line change
Expand Up @@ -1857,6 +1857,16 @@ function getURL(req) {
}
```

The example above assumes well-formed headers are forwarded from a reverse
proxy to your Node.js server. If you are not using a reverse proxy, you should
use the example below:

```js
function getURL(req) {
return new URL(req.url || '/', 'https://example.com');
}
```

### `url.resolve(from, to)`

<!-- YAML
Expand Down
Loading