Skip to main content

Reverse proxy middleware

This quickstart will cover how to deploy a small piece of middleware that reverse proxies another server (in this case For additional examples of common middleware functions, see the example gallery.

Step 1: Create a new playground project on Deno Deploy

Navigate to and click on the "New Playground" button.

Step 2: Deploy middleware code via playground

On the next page, copy and paste the code below into the editor. It is an HTTP server that proxies all requests to

async function reqHandler(req: Request) {
const reqPath = new URL(req.url).pathname;
return await fetch("" + reqPath, { headers: req.headers });


Click Save and Deploy.

You should see something like this: