511 Network Authentication Required

You need to sign in to the network before you can reach the internet.

Code
511
Reason phrase
Network Authentication Required
Class
5xx Server error
Defined in
RFC 6585 section 6
Cacheable by default
No

What it means

Server error: the request may be fine, but the server failed to carry it out.

When a server should send it. By a captive portal (hotel, airport or train Wi-Fi) that intercepts traffic until the user signs in. The body should link to the login page. Real websites never send it.

Common causes. Hotel, airport or café Wi-Fi with a login page (a captive portal).

What to do. Open any http page in the browser to get the login page, then sign in.

How clients and crawlers treat it

Browsers and HTTP clients. Operating systems detect captive portals by fetching a known test URL and open the login page themselves; browsers show the body.

Google Search. Googlebot treats 5xx responses as a sign of trouble and temporarily slows its crawl rate. Already indexed URLs are kept at first, but are dropped if the errors continue. Source: Google Search Central, How HTTP status codes, and network and DNS errors affect Google Search.

Caching. Not cacheable by default (RFC 9110 section 15.1 does not list it). A cache stores it only when the response says so with Cache-Control or Expires.

Example response

HTTP/1.1 511 Network Authentication Required
Content-Type: text/html; charset=utf-8

Network Authentication Required

How to send 511

nginx
location /example {
    return 511;
}
Apache (.htaccess)
RewriteEngine On
RewriteRule ^example$ - [R=511,L]
PHP
http_response_code(511);
echo 'Network Authentication Required';
exit;
Node.js
res.writeHead(511, { 'Content-Type': 'text/plain' });
res.end('Network Authentication Required');
Python (Flask)
# in a view function
return 'Network Authentication Required', 511

Change the paths to suit. In nginx, add_header needs always to apply to error responses.

Related codes

All status codes · All 5xx codes

Names and numbers from the IANA HTTP Status Code Registry. Google Search behaviour as documented by Google Search Central.