DevToolsmith

HTTP 511 Network Authentication Required

HTTP 511 Network Authentication Required means you must log in to the network first, typically a Wi-Fi captive portal. The server failed to fulfil a valid request. The problem is on the server side.

Class
5xx Server error
Standard
RFC 6585
Cacheable by default
No
Safe to retry
Rarely
Go constant
http.StatusNetworkAuthenticationRequired

What HTTP 511 means

Hotel, airport and café Wi-Fi intercept requests until you accept their terms. 511 lets them signal that clearly instead of returning a fake page that looks like the site you asked for.

Retrying

Rarely. The server can’t handle this request, so retrying it unchanged is unlikely to help.

Example response

HTTP/1.1 511 Network Authentication Required
Date: Wed, 21 Oct 2026 10:30:00 GMT
Content-Type: application/json

How to return 511

Node.js (Express)
res.status(511).json({ error: 'Network Authentication Required' });
Python (FastAPI)
from fastapi import HTTPException

raise HTTPException(status_code=511, detail="Network Authentication Required")
Go (net/http)
http.Error(w, http.StatusText(http.StatusNetworkAuthenticationRequired), http.StatusNetworkAuthenticationRequired)
nginx
location /private/ {
    return 511;
}

Related status codes

Other 5xx status codes

500 Internal Server Error · 501 Not Implemented · 502 Bad Gateway · 503 Service Unavailable · 504 Gateway Timeout · 505 HTTP Version Not Supported · 507 Insufficient Storage · 508 Loop Detected · 520 Web Server Returned an Unknown Error · 521 Web Server Is Down · 522 Connection Timed Out · 523 Origin Is Unreachable · 524 A Timeout Occurred · 525 SSL Handshake Failed · 526 Invalid SSL Certificate

See the full list of HTTP status codes.

Sources

Spotted a mistake? Email hello@devtoolsmith.com and we’ll fix it.

Frequently asked questions

What does HTTP 511 Network Authentication Required mean?

HTTP 511 Network Authentication Required means you must log in to the network first, typically a Wi-Fi captive portal. Hotel, airport and café Wi-Fi intercept requests until you accept their terms. 511 lets them signal that clearly instead of returning a fake page that looks like the site you asked for.