0TODO WEB > URI > Max length

· EOG, like EOF


Table of Contents

WEB > URI > Max length #

Q: Browser said: "414 Request-URI Too Large" - So how long are URI allowed #

A 414 Request-URI Too Large error means the server refused your request because the URL exceeded what it is willing (or configured) to accept. #

There is no universal maximum URL length across the internet β€” it depends on:

Below are the real-world limits.

Typical Maximum URL Lengths #

Browsers #

Browser Practical Max URL Length
Chrome ~2 MB for internal processing, but servers usually fail long before this
Firefox ~65,536 characters
Safari ~80,000+ characters
Edge ~65,536 characters

⚠️ Browsers rarely impose the limiting factor β€” servers do.

Servers #

Nginx #

Apache #

IIS (Windows Server) #

Reverse Proxies / CDNs #

Often the tightest restrictions.

Service URL Length Limit
Cloudflare ~32 KB
AWS ALB 16 KB
NGINX reverse proxy 8–64 KB (configurable)

3 Summary #

Most servers reject URLs that exceed:

πŸ‘‰ 8 KB (common defaults) #

or

πŸ‘‰ 16–32 KB (when configured larger) #

If you get 414 Request-URI Too Large, it means:

3 Fixes #

To avoid 414 errors:

βœ” Use POST instead of GET** for large data #

βœ” Remove unnecessary query parameters #

βœ” Compress or shorten the data (e.g., base64 β†’ gzip) #

βœ” URL-shortening logic for huge client parameters #

Q: #

nginx/1.18.0 (Ubuntu)

For nginx/1.18.0 (Ubuntu), the default limits that cause 414 Request-URI Too Large are:

3 Default Nginx Limits (Ubuntu 20.04 / 22.04 packages) #

1. Maximum request line size #

large_client_header_buffers 4 8k;

Meaning:

2. Maximum header size #

client_header_buffer_size 1k;
large_client_header_buffers 4 8k;

So effectively:

πŸ‘‰ Your URL cannot exceed ~8 KB #

(about 8192 characters, measured after URL-encoding)

If the URL is longer, Nginx returns:

414 Request-URI Too Large

3 How to Increase URL Size Limit (Nginx) #

Edit /etc/nginx/nginx.conf or a site in /etc/nginx/sites-available/ inside the http {} or server {} block:

client_header_buffer_size 16k;
large_client_header_buffers 4 32k;

Safe values:

Some people go up to 64k, but 32k is common and safe.

Then reload:

sudo nginx -t
sudo systemctl reload nginx

3 Absolute Limit #

At maximum tuning, Nginx can handle:

πŸ‘‰ up to ~64 KB URLs

It cannot go beyond that because of internal limits and diminishing returns.

3 Quick Rule of Thumb #

If you don't reconfigure anything:

Nginx on Ubuntu 1.18.0 only accepts URLs ≀ 8 KB #

If you configure buffers:

It will accept up to ~32 KB safely, ~64 KB max. #


If you want, you can paste the URL (or just its approximate length), and I can tell you exactly whether it will pass after tuning.

last updated:

Β