diff --git a/gateway-ha/gateway-ha-config.yml b/gateway-ha/gateway-ha-config.yml index 70f1ee92..e8cd62e0 100644 --- a/gateway-ha/gateway-ha-config.yml +++ b/gateway-ha/gateway-ha-config.yml @@ -6,6 +6,10 @@ requestRouter: port: 8080 name: prestoRouter historySize: 1000 + requestHeaderSize: 2048000 + responseHeaderSize: 2048000 + requestBufferSize: 2048000 + responseBufferSize: 2048000 dataStore: jdbcUrl: jdbc:mysql://127.0.0.1:3306/prestogateway diff --git a/gateway-ha/src/main/java/com/lyft/data/gateway/ha/module/HaGatewayProviderModule.java b/gateway-ha/src/main/java/com/lyft/data/gateway/ha/module/HaGatewayProviderModule.java index edadc249..d0184393 100644 --- a/gateway-ha/src/main/java/com/lyft/data/gateway/ha/module/HaGatewayProviderModule.java +++ b/gateway-ha/src/main/java/com/lyft/data/gateway/ha/module/HaGatewayProviderModule.java @@ -81,6 +81,7 @@ public ProxyServer provideGateway() { routerProxyConfig.setKeystorePass(routerConfiguration.getKeystorePass()); routerProxyConfig.setForwardKeystore(routerConfiguration.isForwardKeystore()); routerProxyConfig.setPreserveHost("false"); + ProxyHandler proxyHandler = getProxyHandler(); gateway = new ProxyServer(routerProxyConfig, proxyHandler); } diff --git a/proxyserver/src/main/java/com/lyft/data/proxyserver/ProxyServer.java b/proxyserver/src/main/java/com/lyft/data/proxyserver/ProxyServer.java index 0d22efb7..bcc690bf 100644 --- a/proxyserver/src/main/java/com/lyft/data/proxyserver/ProxyServer.java +++ b/proxyserver/src/main/java/com/lyft/data/proxyserver/ProxyServer.java @@ -59,6 +59,7 @@ private void setupContext(ProxyServerConfiguration config) { sslContextFactory.setStopTimeout(TimeUnit.SECONDS.toMillis(15)); sslContextFactory.setSslSessionTimeout((int) TimeUnit.SECONDS.toMillis(15)); + if (!TextUtils.isBlank(keystorePath)) { sslContextFactory.setKeyStorePath(keystoreFile.getAbsolutePath()); sslContextFactory.setKeyStorePassword(keystorePass); @@ -68,13 +69,18 @@ private void setupContext(ProxyServerConfiguration config) { HttpConfiguration httpsConfig = new HttpConfiguration(); httpsConfig.setSecureScheme(HttpScheme.HTTPS.asString()); httpsConfig.setSecurePort(config.getLocalPort()); + httpsConfig.setIdleTimeout(150000); httpsConfig.setOutputBufferSize(32768); + httpsConfig.setRequestHeaderSize(2048000); + httpsConfig.setResponseHeaderSize(2048000); + + SecureRequestCustomizer src = new SecureRequestCustomizer(); src.setStsMaxAge(TimeUnit.SECONDS.toSeconds(2000)); src.setStsIncludeSubDomains(true); httpsConfig.addCustomizer(src); - httpsConfig.addCustomizer( new org.eclipse.jetty.server.ForwardedRequestCustomizer() ); + httpsConfig.addCustomizer(new org.eclipse.jetty.server.ForwardedRequestCustomizer()); connector = new ServerConnector( server, diff --git a/proxyserver/src/main/java/com/lyft/data/proxyserver/ProxyServletImpl.java b/proxyserver/src/main/java/com/lyft/data/proxyserver/ProxyServletImpl.java index 385dd56e..b541f589 100644 --- a/proxyserver/src/main/java/com/lyft/data/proxyserver/ProxyServletImpl.java +++ b/proxyserver/src/main/java/com/lyft/data/proxyserver/ProxyServletImpl.java @@ -45,7 +45,9 @@ protected HttpClient newHttpClient() { HttpClient httpClient = new HttpClient(sslFactory); httpClient.setMaxConnectionsPerDestination(10000); - httpClient.setConnectTimeout(TimeUnit.SECONDS.toMillis(60)); + httpClient.setConnectTimeout(TimeUnit.SECONDS.toMillis(65)); + httpClient.setIdleTimeout(TimeUnit.SECONDS.toMillis(65)); + return httpClient; }