NewIP VPN Notes
VPNs

406 Not acceptable

By Priya Castellanos · · 6 min
406 Not acceptable

A clear guide to understanding, diagnosing, and fixing HTTP 406 Not Acceptable errors.

HTTP 406 Not Acceptable is one of several client error responses you might see when a web server cannot supply a response that matches the criteria defined by the client’s request. In practice, 406 is most often a signaling mechanism about content negotiation: the client asked for a format, language, or encoding that the server is not willing or able to provide. This article walks you through what causes 406, how to diagnose it, and practical steps to resolve it for both users and developers.

What does 406 Not Acceptable mean?

406 is an HTTP status code from the family that indicates a client-side issue with content negotiation. The server is effectively saying:

  • I cannot respond using any of the formats you listed in your Accept header.
  • I cannot produce content in your preferred language or encoding if you specified those negotiators.
  • There is no available representation that satisfies the request’s criteria.

Key idea: 406 does not necessarily mean something is broken with the server. It can be a mismatch between what the client asks for and what the server can provide.

406 Not acceptable: Checklist

How content negotiation works

Content negotiation is the mechanism that lets a client tell the server what it can accept, in terms of media type, language, encoding, and character sets. A typical request might include:

  • Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
  • Accept-Language: en-US,en;q=0.9
  • Accept-Encoding: gzip, deflate
  • Accept-Charset: utf-8

The server compares these preferences with the representations it can generate and with its available resources. If there is no acceptable representation, the server returns 406. Binance card activation: step-by-step

Common causes of 406 Not Acceptable

  • The server has only a single content representation, and the client requests something else via Accept headers.
  • A misconfigured API or proxy that rewrites headers, making the client’s preferences appear unmet.
  • A dynamic site that previously offered HTML but now must deliver only JSON, or vice versa, and the client’s request is not aligned.
  • Content negotiation in APIs where media types are strict (for example, your API expects application/json but client requests application/xml).
  • Encoding or charset negotiations where the server cannot deliver the requested charset.

Diagnosing 406: steps for users and developers

  • Reproduce the error:
  • Try the same URL in different browsers or with a simple curl/wget command to isolate header behavior.
  • Use a minimal request that sets very broad Accept headers, e.g., Accept: /.
  • Inspect request headers:
  • Look at Accept, Accept-Language, Accept-Encoding, and Accept-Charset. Identify any overly restrictive or unusual values.
  • Check server logs (for developers/admins):
  • See what representations the server is capable of producing and what it attempted to serve.
  • Look for middleware, proxies, or CDNs that might alter headers.
  • Examine proxies and CDNs:
  • Some edge services enforce strict content negotiation or alter Accept headers, causing 406s.
  • Test with different content representations:
  • If you control the server, ask it to respond with a known good type (e.g., text/html or application/json) and see if the 406 persists.

Practical fixes for users

  • Relax your Accept headers:
  • If you’re scripting or using a tool, set Accept: / or Accept: application/json, text/html to widen the accepted formats.
  • Clear caches:
  • Browser caches or intermediate proxies can store earlier, incompatible responses. Clear cache or bypass the cache (Ctrl/Cmd + Shift + R).
  • Try a direct URL or alternate path:
  • Some sites route certain Accept headers differently. A direct page or a non-API endpoint may work.
  • Use developer tools:
  • In the browser’s DevTools, inspect the Network tab to view the exact request and response headers. This helps confirm what the server rejected.

Practical fixes for developers and site operators

  • Review and normalize content negotiation logic:
  • Ensure there is a fallback representation if a preferred one is unavailable.
  • Align API and client expectations:
  • If your API can produce multiple formats, document the supported media types and ensure clients request compatible ones.
  • Provide sane defaults:
  • When the client’s Accept header is too restrictive, default to a broadly compatible format like application/json or text/html.
  • Adjust server configuration:
  • In some servers (Apache, Nginx), custom 406 responses can be triggered by modules or rewrite rules. Verify these configurations.
  • Check intermediaries:
  • Proxies and CDNs may apply their own content negotiation rules. Test origin server responses directly to isolate issues.
  • Implement explicit content negotiation handling in code:
  • For example, in a web app, detect unacceptable requests early and return 406 with a helpful message rather than a generic error.
406 Not acceptable: Key points

Quick-reference: common patterns and how to handle them

Scenario Client behavior Server behavior What to do
Client requests HTML but server only has JSON Accept: text/html, application/json Server cannot provide text/html, returns 406 Provide an HTML representation or adjust client to accept JSON.
Client requests multiple languages not supported Accept-Language: fr-CA, fr, en-US Server has en-US but not fr Add en-US fallback or respond with a 406 if no acceptable language.
API returns 406 due to strict media type Accept: application/xml Server only supports application/json Update client to request application/json or server to support XML.
Proxy rewrites headers causing mismatch Proxy modifies Accept header Server cannot fulfill new header Configure proxy to preserve headers or bypass proxy for debugging.

When 406 might be a symptom of a bigger issue

  • Misconfigured content negotiation on a newly deployed site.
  • A misbehaving reverse proxy or CDN edge that alters headers in transit.
  • API versioning changes where older clients still request values that no longer exist on the server.
  • A caching layer serving stale representations that no longer match the current negotiation rules.

How to verify a fix

  • Reproduce the problem in a clean environment (bypass caches and proxies).
  • Confirm that the same Accept headers yield a valid representation after changes.
  • Use curl or a similar tool to test with explicit Content-Type and Accept headers:
  • curl -i -H "Accept: application/json" http://example.com/api/resource
  • Check server and proxy logs for a successful negotiation path after changes.

Final recommendations

  • If you’re a user: start by relaxing Accept headers and clearing caches. If the problem persists on a site you rely on, contact the site’s support with the exact request headers you sent and the response you received.
  • If you’re a developer or site operator: audit your content negotiation flow. Ensure you offer a reasonable default representation, document the supported media types, and test across common client configurations. Check any intermediate proxies or CDNs that might influence headers. A well-handled 406 is less a fault and more a clear, actionable signal about the server’s capability to respond to a client’s request format.

If you want, I can tailor this guidance to a specific stack (Apache, Nginx, Node.js, Python Flask/Django, or a particular CDN) and provide concrete configuration examples.

© 2026 Northlight Network Notes · Northlight Network Notes LLC