Monitor Protected Endpoints
Not every URL worth watching is open to the world. Staging sites, internal dashboards, metrics pages, admin panels — the endpoints that matter most are often the ones locked behind a login. To monitor a password protected endpoint, your checker needs to authenticate exactly like a browser would, sending a username and password with every request so the server returns the real page instead of a 401 Unauthorized. This guide covers how HTTP Basic authentication works on the wire, how to protect an endpoint with .htpasswd, and how to store those credentials so an external monitor can log in and keep watch around the clock.
What is Monitor Protected Endpoints
Monitoring a protected endpoint means running an availability check against a URL that requires authentication, with the check supplying valid credentials so it gets through. Without them, the monitor hits the login wall, records a 401, and either alarms falsely or — worse — reports the auth page itself as "up" while your actual application is down behind it. Neither is useful.
Basic auth monitoring solves this by teaching the checker to present a username and password, the same HTTP Basic Authentication scheme defined in RFC 7617. When the credentials are valid, the server hands back the protected content and the monitor can measure it properly: response time, status code, and any content or custom-data checks you've layered on top.
You need this whenever the thing you care about isn't public. A pre-production environment gated so search engines and strangers can't reach it. An internal metrics endpoint. A partner API behind a shared secret. Any of these can fail silently if the only monitoring you have can't get past the door — which is exactly why authenticated checks belong in the toolkit.
How it works
HTTP Basic authentication is refreshingly simple, and that simplicity is the point. When a client requests a protected resource without credentials, the server replies 401 Unauthorized and a WWW-Authenticate: Basic realm="..." header. The client then retries, this time adding an Authorization header containing the word Basic followed by the base64 encoding of username:password. The server decodes it, checks it against its user file, and either serves the resource or rejects it.
That's the whole handshake. Base64 is encoding, not encryption, though — anyone who can read the header can decode the password trivially. That single fact drives every recommendation on this page.
| Element | Value / Meaning |
|---|---|
| Standard | RFC 7617 — the "Basic" HTTP Authentication Scheme |
| Challenge | 401 Unauthorized + WWW-Authenticate: Basic |
| Credential header | Authorization: Basic base64(user:pass) |
| Encoding | Base64 — reversible, not encryption |
| Success | 200 OK with the protected content |
| Credential store (server) | .htpasswd file, one user:hash per line |
| Transport requirement | HTTPS — mandatory to keep credentials confidential |
Because the credential is only obscured, never encrypted, Basic auth is safe only over TLS. Serve a protected endpoint over plain HTTP and you're broadcasting the password to anything on the network path. Over HTTPS the whole exchange rides inside the encrypted tunnel, and htpasswd monitoring becomes perfectly reasonable.
One detail catches people out: Basic auth is stateless. There's no session, no cookie, no login-once-and-you're-in. The client resends the Authorization header on every request, because the server keeps no memory of the last one. For monitoring that's actually ideal — each scheduled check is fully self-contained, with no session to expire between polls and nothing to refresh. It also means the .htpasswd file is the single source of truth. Rotate a monitoring password there and every future check simply fails until you update the stored credential, which makes credential hygiene refreshingly predictable compared with token flows that expire on their own schedule.
Setup
Two halves here: protect the endpoint on the server, then give your monitor the credentials to reach it.
- Create the password file with Apache's
htpasswdtool, which hashes the password rather than storing it in the clear:htpasswd -c /etc/nginx/.htpasswd monitor. Drop the-cflag when adding a second user so you don't overwrite the file. - Require auth on the location. In Nginx:
The Apache equivalent useslocation /internal/health { auth_basic "restricted"; auth_basic_user_file /etc/nginx/.htpasswd; }AuthType Basic,AuthUserFile, andRequire valid-user. - Serve it over HTTPS. This isn't optional — Basic auth without TLS leaks the password. Redirect HTTP to HTTPS and make sure the certificate is valid.
- Reload and verify by hand. A request without credentials should return
401; one with them should return200. Test both:curl -i https://example.com/internal/health # expect 401 curl -i -u monitor:secret https://example.com/internal/health # expect 200 - Store the credentials in your monitor. In ostr.io, the endpoint's security settings hold the username and password; the service keeps them for the check and sends them with each request automatically.
- Set thresholds and frequency. Alert on status codes and response time, and consider two checks at different frequencies for a fuller trend.
Use a dedicated, least-privilege account for monitoring — never a real admin login — so the credentials you hand to a third-party checker can only read a health page and nothing more.
Screenshot walkthrough

The screenshot shows the ostr.io security settings for an HTTP endpoint, where the Basic authentication username and password are entered and saved against the check. Once stored, the service attaches those credentials to every scheduled request, so a protected URL responds with its real content instead of a 401. What the panel makes clear is that this is server-side credential storage tied to a single endpoint — you configure it once and the monitor authenticates on your behalf from then on, from outside your network. It sits with the standard availability controls, so an authenticated check still records response time, status code, and uptime like any public URL. That's the practical bridge between an endpoint locked down with .htpasswd and continuous availability monitoring that doesn't stop at the login wall.
Use cases
Authenticated checks matter in more places than people expect:
- Staging and pre-production. Environments gated behind Basic auth so they stay out of search results and away from the public still need uptime coverage before they ship.
- Internal dashboards. Grafana, admin consoles, and status boards protected by a login benefit from an outside check that confirms they're reachable.
- Metrics and health endpoints. A
/metricsor/healthroute you deliberately hid behind auth can only be monitored if the checker can log in. - Partner and B2B APIs. Endpoints secured with a shared credential need the same watchful eye as public ones — arguably more, since fewer people would notice an outage.
- Content-change detection on private pages. Watching a protected page for unexpected changes only works once the monitor gets past authentication.
- Compliance-gated tools. Internal systems that must not be public still have SLAs, and htpasswd monitoring keeps them honest.
