POST /login requests, all returning 200 OK. You grep for 401 or 403 to find brute-force attempts and find almost nothing. Everything looks clean. Meanwhile, accounts are getting taken over. The problem: many web applications return HTTP 200 for both successful and failed login attempts. The status code alone tells you nothing about what actually happened.
This is not a rare edge case. Frameworks like Django, Laravel, WordPress, and many custom apps render the login form again with an error message on failure — still a 200. A successful login might also return 200 before issuing a client-side redirect via JavaScript. If your monitoring pipeline counts status codes and nothing else, credential stuffing attacks are invisible.
Why status codes hide credential stuffing
200, rate-limiting by status code is useless. You need a different signal. Three signals are available in standard reverse proxy access logs without touching application code: response body size, redirect behavior, and Set-Cookie presence.
Step 1: Find the body-size split in your logs
POST /login (or whatever your login path is) requests that returned 200. In a standard Nginx combined log format or Apache combined format, the response body size is typically the field after the status code.
BASH
# Extract status code and body size for POST requests to /login
# Adjust field positions if your log format differs
awk '6 ~ /POST/ &&7 ~ /\/login/ && 9 == 200 {print10}' /var/log/nginx/access.log | sort -n | uniq -c | sort -rn | head -20TEXT
8423 4892
312 4910
47 1843
12 1851
3 2204Step 2: Correlate the outlier sizes with IPs and usernames
BASH
# Find IPs that got the smaller (successful) response body
# Replace 1843 with whatever your success body size is
awk '6 ~ /POST/ &&7 ~ /\/login/ && 9 == 200 &&10 >= 1840 && 10 <= 1860 {print1}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head -20Step 3: Check redirect targets for 302 responses
/dashboard while a failure gets a 302 back to /login.
Nginx does not log the Location header by default. You can add it to your log format:
In your Nginx config, define a custom log format that includes sent_http_location. The exact directive depends on your setup, but the key variable is sent_http_location for Nginx. For Apache, %{Location}o captures outgoing Location headers. After adding this, grep for 302 responses on your login endpoint and check whether the Location header points to a post-login page or back to the login form.
This distinction — redirect-to-dashboard versus redirect-to-login — is your success/failure signal when the status code is 302 in both cases.
Step 4: Look for Set-Cookie as a success indicator
Set-Cookie header was present in the response, you have another reliable signal.
Neither Nginx nor Apache log response headers by default. For Nginx, $sent_http_set_cookie captures the Set-Cookie header value. You probably do not want to log the full cookie value (it contains the session token), so a common approach is to log just its presence or length. Some setups use a map directive to convert the header into a boolean flag before writing it to the log.
Once you have this in your logs, the query is straightforward: any POST /login that returned 200 and included a Set-Cookie header with a session cookie name is a successful login. Cross-reference those with the body-size analysis from Step 1 to double-check your findings.
Step 5: Build a baseline, then alert on deviations
What this does not cover
200 OK as a single bucket. Run the body-size frequency query against your login endpoint today. If you see two distinct clusters, you now know which one means "someone got in." That ten-minute check surfaces compromises that status-code monitoring misses entirely.