This error code feels pretty magical. Very few people have ever heard of this error. Write down a few steps for troubleshooting.

Request Header Fields Too Large Request Header Fields Too Large

In some cases, the client can send HTTP Request headers that become Too Large, so the server can send 431 Request Header Fields Too Large to indicate the problem.

The body of the

First, let’s talk about my solution: domain name problem: modify the front-end vue.config.js

Proxy: {target: 'http://127.0.0.1:8080'}Copy the code

The port number must be added after the domain name. The port number can be changed according to the service. Since most projects are handled through nginx proxies, online servers are not required. Local modify according to its own needs.

If this is not a problem, here are the other methods:

Plan a

Locate the YML file in the SpringBoot project

server:
  port: 8090
  tomcat:
    max-swallow-size: -1
  max-http-header-size: 2MB
Copy the code

Append max-http-header-size to server.

Scheme 2

Check the Nginx configuration file: nginx.conf

http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' #  '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; client_header_buffer_size 10240k; large_client_header_buffers 6 10240k; }Copy the code

Check the last two lines of code to see if they exist and add them.

Plan 3

Front-end vue.config.js beware of proxy issues

pathRewrite: {
  ['^' + process.env.VUE_APP_BASE_API]: ''
}
Copy the code

Check for backslashes

Plan 4

Clear the browser’s cookie cache and reload.

So that’s the solution to this problem. If there is any additional hope that we comment to inform.

Druid: 1.2.1 druid: 1.2.1 druid: 1.2.1

The above is the error of HTTP ErrorCode 431. If there is something wrong or better advice, PLEASE kindly advise. Thank you for watching.