Skip to main content

Technical Decisions

Reverse Proxy

A reverse proxy sits between visitors and your application, handling encryption, routing and filtering. It is usually already there, doing more than people realise.

Definition

A reverse proxy sits in front of your application and receives every request before the application does. It decides what to do with each one, passes it on, and returns the response.

What It Actually Means

Visitors never talk to the application directly. They talk to the proxy, which is usually Nginx, and often something like Cloudflare in front of that as well.

What It Is Actually Doing

More than routing, and most of it is work you would otherwise have to build.

Handling encryption. The certificate usually lives here, so the application does not deal with it. This is why certificate renewal is a hosting concern rather than an application change.

Serving static files. Images, stylesheets and scripts are returned directly without troubling the application, which is substantially faster and removes most of the request volume.

Routing. Sending requests for different addresses to different applications, which is how several systems live behind one domain.

Caching. Holding responses so repeated requests are answered without the application running at all.

Filtering and limiting. Blocking obvious abuse and applying rate limits before anything reaches your code.

Compression, which reduces what has to travel to the visitor.

Why It Is Worth Knowing About

Two reasons, both practical.

It explains confusing behaviour. When a change does not appear, when a file is served that should have been replaced, or when something works locally and not in production, the proxy is a common cause. Its cache and its configuration sit above the application and are frequently overlooked because the application is where people look.

It is where several problems get solved cheaply. Rate limiting, blocking a troublesome source, redirecting old addresses, forcing HTTPS. All are configuration rather than development, which makes them fast and low-risk compared with changing the application.

Where It Causes Trouble

Stale cached content, the same issue as any caching layer, with the added confusion that it is above the application so clearing the application cache does nothing.

Configuration drift. Proxy configuration is frequently edited by hand on the server and not recorded anywhere, so nobody can reproduce it and a rebuild loses it. It belongs in version control alongside everything else.

Timeouts. The proxy will give up waiting for the application after a set period, and a long-running request such as a large report or import fails with an unhelpful error even though the application was still working.

What To Ask

  • What sits in front of our application? There is nearly always something, and sometimes more than one thing.
  • Is its configuration in version control? If it only exists on the server, it is unbacked.
  • Does it cache, and how do we clear it? Better to find out before a launch than during one.
  • What are the timeouts? Relevant for anything slow, and the cause of errors that look like application faults.
  • Are redirects handled here? Frequently the cheapest place to do them, and it is where old ones accumulate unreviewed.

More terms are in the glossary.

Portrait of Alexander De Sousa, founder of Digital Royalty
Founder-led
“I’ve put everything I know into how this company works — the standards, the method, the care on every project. It runs through the whole team, and I hold us all to it.”

Alexander De Sousa · Founder LinkedIn

Featured on BBC Radio Solent

Get started

Tell us what you need

A few quick questions, then a straight answer from a real person — usually within a few hours.

What happens next

  1. 1 We reply A real person reads your answers and gets back to you, usually within a few hours.
  2. 2 Questions or a short call If anything isn't clear, we ask by email or book a short call. Before any call we audit your website and make the quick fixes it finds, free.
  3. 3 Your fixed quote A clear, fixed price in writing, within 48 hours of any call. There is no obligation to go ahead.

Tell us what you're working on

Whether it's a new site, a platform, or a process that shouldn't be manual any more — we'll tell you honestly if we can help.