Table of Contents
- 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.
- Browsers
- Servers
- Reverse Proxies / CDNs
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:
- the browser
- the web server (Apache, Nginx, etc.)
- intermediate systems (proxies, load balancers)
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 #
- Default allowed request line: 8 KB
(
large_client_header_buffers 4 8k;) - Can be increased to: 32 KB β 64 KB safely
Apache #
- Default 8 KB for
LimitRequestLine - Can increase to up to 128 KB
IIS (Windows Server) #
- Default: 16 KB
- Maximum configurable: 16 KB (hard limit)
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:
- the URL was too long for that serverβs configuration
- often caused by too many query parameters, long base64 strings, or large GET requests
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:
- max 8 KB allowed for the request line β this includes the URL (path + query string)
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:
- 16k request header buffer
- 32k max request line
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.
