在 Heroku 上修改 Tomcat 连接器设置

Modifying Tomcat Connector settings on Heroku

Heroku 的 webapp-runner.jar 在 Tomcat 上运行,默认 Tomcat maxPostSize2MB。我需要增加这个值,但不知道该怎么做。

我在 https://github.com/jsimone/webapp-runner#options (this is the runner to which official Heroku documentation points to). There is a maxPostSize connector option in the Tomcat documentation (https://tomcat.apache.org/tomcat-8.5-doc/config/http.html 中没有看到此设置的参数)但我不知道如何将它传递给 webapp-runner

无奈之下,我尝试在 WEBAPP_RUNNER_OPTS 中设置 --maxPostSize,但是当我启动应用程序时,我得到:

  Exception in thread "main" com.beust.jcommander.ParameterException: 
  Unknown option: --maxPostSize=8388608

虽然我试图增加最大 post 大小,但这个问题与任何其他 Tomcat 连接器参数相关。

解决方法是:

 heroku config:set WEBAPP_RUNNER_OPTS="-AmaxPostSize=12582912"

不过,您必须引用相对较新版本的 webrunner。