title: tomcat8 - custom error page for 400
body: <p>In Tomcat (v8.5.24) an URL with a query parameter containing an unencode curly brace ("{") produces a 400 error.</p>
  
  <p>You can configure Tomcat to allow it with "relaxedQueryChars". But this is not what I want. I tried to write a custom error page and add it to web.xml</p>
  
  <pre><code>&lt;error-page&gt;
          &lt;error-code&gt;400&lt;/error-code&gt;
          &lt;location&gt;/error/error400&lt;/location&gt;
  &lt;/error-page&gt;
  </code></pre>
  
  <p>But this does not work as Tomcat is really killing the request and does not process the error pages (org.apache.coyote.http11.Http11Processor:737)</p>
  
  <p>It seems there is no way to handle it. Now I tried to handle it in nginx. But to handle it there I need to set "proxy_intercept_errors = on" and I don't want to intercept all error codes from my proxy.</p>
  
  <p>So no luck rendering a custom 400 page in this scenario? Or is there any workaround?  </p>