Error fix · Server errors

HTTP 511 Network Authentication Required: Captive Portal Fix

HTTP 511 means your network, not the website, wants you to log in first. Complete the Wi-Fi captive portal, or fix a gateway that returns 511 to clients.

Error messageHTTP 511 Network Authentication Required

By SiteDownCheck Editorial · Updated November 18, 2026 · 4 min read

A 511 is not a message from the website you asked for. It comes from a network gateway between you and the site, usually a captive portal on hotel, airport, cafe, school or corporate Wi-Fi, saying you must authenticate before you get network access. It was added by RFC 6585 for that purpose. See the HTTP 511 reference.

That makes this status unusual: the fix is almost never on the site you were trying to open. Visitors fix it by logging in to the network. Network owners fix it by making their portal answer correctly.

If you are a visitor

  1. Open a plain HTTP page to trigger the login page. Secure HTTPS sites cannot be intercepted cleanly, so the portal often fails to appear. Try http://neverssl.com, or a connectivity check address such as http://captive.apple.com or http://connectivitycheck.gstatic.com/generate_204, which devices use for exactly this.
  2. Complete the portal. Accept terms, enter a room number, voucher code or password, then reload your original page.
  3. Disable a VPN or custom DNS temporarily. A VPN may block the portal from reaching you, and a hard-coded DNS server such as a public resolver can prevent the portal's DNS redirect from working. Log in first, then turn them back on.
  4. Turn off Private DNS or "secure DNS" in your browser for the login, for the same reason.
  5. Forget and rejoin the Wi-Fi network if the portal never appears, or switch between 2.4 GHz and 5 GHz networks if the venue offers both.
  6. Check the time and date on the device. A wrong clock causes certificate warnings that can hide the portal.

If the network is yours and you cannot log in, contact the network administrator. If other devices on the same Wi-Fi work, clear the saved portal session on this device and try again.

If you run a network or gateway

The correct behavior, per the specification, is for the intercepting device to return 511 with a body containing a link to the login page, rather than faking a 200 or 302 for every site. A 200 containing a login form is misread by apps, caches and monitoring as the real page, which is a common source of bugs.

The response should be 511, include a Link or HTML link pointing to the portal, and mark the response as not cacheable. A sketch of the idea:

HTTP/1.1 511 Network Authentication Required
Content-Type: text/html
Cache-Control: no-store

<html><body>Please <a href="https://portal.example.net/login">sign in</a> to use this network.</body></html>

Check your gateway or captive portal product documentation for how it handles unauthenticated clients, as the setting names differ.

2. Do not break HTTPS and HSTS sites

Sites with HSTS cannot be intercepted by a portal without certificate errors. Redirect only the connectivity-check domains and plain-HTTP requests to the portal, and let HTTPS traffic wait until login is complete. See the HSTS Checker if you are unsure which domains are preloaded.

3. Fix DNS interception

Many portals answer DNS queries with the portal's IP until the user logs in. If clients use a different DNS server, the portal never intercepts them. Allow DNS to the portal resolver, and verify with the DNS Checker after authentication that real addresses are returned.

4. Prevent a stale authentication session

After the session timeout, clients land on 511 again. Choose a sensible session length, whitelist devices by MAC with care, and make sure the portal handles roaming between access points without logging users out. Excessive 511 reports from one location are usually this.

5. If your website returns 511

If your own site returns it, a security product, reverse proxy, or application framework is mimicking a network login. Find the layer with curl -I https://example.com/ and the HTTP Header Checker, then remove or reconfigure it. A normal website should return 401 or 403 for its own authentication, not 511.

How to verify

From a device on the network, run:

curl -i http://captive.apple.com/
curl -i http://connectivitycheck.gstatic.com/generate_204

Before login you should see the 511 or the portal redirect. After login you should receive the real responses (the Apple page shows a short "Success" document and the Google endpoint returns 204 with no body). Then load the target site and confirm with the HTTP Status Checker.

If you monitor sites from inside such a network, expect false alerts. An Uptime Monitor running outside the network avoids that.

Next steps

FAQ

Is a 511 a problem with the website?

No. The site never received your request. A device on your network intercepted it and asked you to authenticate.

Why can't I see the login page on some Wi-Fi?

HTTPS pages cannot be hijacked cleanly. Open an HTTP address such as neverssl.com or turn off VPN and secure DNS until you have logged in.

Is 511 the same as 401 or 407?

No. A 401 comes from the website, and a 407 from a proxy that you configured. A 511 comes from a network gateway that controls access to the network itself.

Can a 511 be cached?

It should not be. Responses should include Cache-Control: no-store, and clients should not treat it as the real page.

Get notified when this fix updates

Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.

This page is general information written by our editorial team and updated when documentation changes. Servers and providers differ, so test changes safely first. See our editorial policy and disclaimer.