Reference guide · http-status · Published 2026-08-16 · 4 min read

HTTP 511 Network Authentication Required explained

HTTP 511 Network Authentication Required explained: who returns it, how captive portals work, and how clients should respond.

What the 511 status code means

HTTP 511 Network Authentication Required means the client must authenticate before it is allowed to use the network at all. It is not an application error and the shown service is not at fault. The response is generated by an intercepting proxy, not the origin server, so a browser or script does not receive the page it asked for.

The most common location you meet 511 is a captive portal, for example the login or terms-of-service page on hotel, airport and coffee-shop Wi-Fi. Internet providers use tag-based access control and identify a device by its Media Access Control (MAC) address; until the device has logged in, the network blocks nearly all traffic and the gatekeeper returns 511.

The status is described in RFC 6585 along with 508 and 509, and it appeared in later HTTP registries. Browsers usually render the 511 body directly, and the operator places a META refresh or a link in that body pointing at the login server. Non-browser clients do not follow that automatically, so they must detect 511 and act on it.

How a captive portal returns it

A typical flow:

  1. The device connects to the Wi-Fi and requests any HTTP page.
  2. The captive portal intercepts the request before it leaves the network and answers with 511 Network Authentication Required.
  3. The response body is a small HTML page with a link or a META refresh to the portal login URL.
  4. The visitor completes the login or accepts the terms on the portal.
  5. The device is then allowed out to the network and can retry the original request.
HTTP/1.1 511 Network Authentication Required
Content-Type: text/html

<html>
  <head>
    <meta http-equiv="refresh" content="0; url=https://login.example.net/">
  </head>
  <body>
    <p>You need to <a href="https://login.example.net/">authenticate with
    the local network</a> to get online.</p>
  </body>
</html>

The redirect target is not the origin you requested, so do not treat the 511 URL as the real site.

How to handle it as a client

A native application, scraper or mobile app should treat 511 as a distinct condition:

CodeWho returns itWhat it asks for
401 UnauthorizedThe origin serverCredentials for the resource
403 ForbiddenThe origin serverAccess denied even with credentials
407 Proxy Authentication RequiredA proxy in the pathCredentials for the proxy
511 Network Authentication RequiredAn intercepting network proxyNetwork access itself

Why your site does not control it

Origin servers should not produce 511, and a 511 on the visitor's screen is almost never something you can change in the site's own code. If users report it, the fix belongs to the network operator or, for a public Wi-Fi network, to the hotel or venue. On a secure connection the captive portal can cause a certificate error because the TLS handshake is also intercepted, which is why many portals keep the login on an ordinary HTTP page.

The related HTTP errors in your site's own logs are a different matter, and a status family breakdown helps you tell a network problem from an origin problem.

Need a website built, fixed, optimised, migrated or replaced?

This technical resource is written by CSMBAC, a small design and development studio. If you would rather hand the problem to a professional, the website service page explains how we build enquiry-ready websites.

Explore website services