Forums

Request-uri too long (Http error 404)

Hi, is there a limitation set for the url length on the server? If yes, can I disable the limit, or allow long urls? (E.g. long url parameter values). Thanks in advance

I think we just stick with the nginx defaults for that. There is a limit of 32K on the total request header size, but that should be sufficient unless you have extremely long URLs...

Do you have a URL that you could send me that shows the problem? You can share it using the "Send feedback" link at the top if you don't want to post it here in public.

[UPDATE] it looks like nginx is restricting each header to 8192 bytes, so that's presumably the problem you're bumping into -- that would make it a 414 error instead of a 404, is that what you're seeing?

Yes, sorry about that, it's 414, not 404. So there's no way to allow long urls?

You may find this SF question interesting, even though it's a few years old. In summary, RFC 2616 ยง3.2.1 recommends URLs no longer than 255 characters. In practice, you'll start hitting browser compatibility issues beyond about 2048 characters, at least in older browsers.

I would strongly recommend not using massive URLs. If you're making genuine GETs where your resources have extremely long names, I suggest converting the resource name to the SHA1 hash of the full name, or something similar. If you're using the URL to upload data, then you should really be making it a POST and providing the data in the request body instead. If you're tracking a lot of client-side context in the URL, consider using cookies and/or server-side session management instead.

Even ignoring the technical constraints, overlong URLs make it very hard to link to pages and generally don't present a nice interface to users.

+1 to what Cartroo says there.