An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
feat: http + h2c paralel
Andras Bacsai7ddac5000849
diff --git a/apps/api/src/routes/webhooks/traefik/handlers.ts b/apps/api/src/routes/webhooks/traefik/handlers.tsindex 25057defc1..ed055bebff 100644--- a/apps/api/src/routes/webhooks/traefik/handlers.ts+++ b/apps/api/src/routes/webhooks/traefik/handlers.ts@@ -4,17 +4,29 @@ import { getTemplates } from '../../../lib/services';import { OnlyId } from '../../../types';function generateServices(serviceId, containerId, port, isHttp2 = false) {- return {+ const payload = {[serviceId]: {loadbalancer: {servers: [{- url: `${isHttp2 ? 'h2c' : 'http'}://${containerId}:${port}`+ url: `http://${containerId}:${port}`}]}}};+ if (isHttp2) {+ payload[`${serviceId}-http2`] = {+ loadbalancer: {+ servers: [+ {+ url: `h2c://${containerId}:${port}`+ }+ ]+ }+ };+ }+ return payload;}function generateRouters(serviceId,@@ -24,18 +36,20 @@ function generateRouters(isHttps,isWWW,isDualCerts,- isCustomSSL+ isCustomSSL,+ isHttp2 = false) {+ let rule = `Host(\`${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`;let http: any = {entrypoints: ['web'],- rule: `Host(\`${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`,+ rule,service: `${serviceId}`,priority: 2,middlewares: []};let https: any = {entrypoints: ['websecure'],- rule: `Host(\`${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`,+ rule,service: `${serviceId}`,priority: 2,tls: {@@ -45,14 +59,14 @@ function generateRouters(};let httpWWW: any = {entrypoints: ['web'],- rule: `Host(\`www.${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`,+ rule,service: `${serviceId}`,priority: 2,middlewares: []};let httpsWWW: any = {entrypoints: ['websecure'],- rule: `Host(\`www.${nakedDomain}\`)${pathPrefix ? ` && PathPrefix(\`${pathPrefix}\`)` : ''}`,+ rule,service: `${serviceId}`,priority: 2,tls: {@@ -137,6 +151,38 @@ function generateRouters(}}}+ if (isHttp2) {+ let http2 = {+ ...http,+ service: `${serviceId}-http2`,+ rule: `${rule} && HeadersRegexp(\`Content-Type\`, \`application/grpc*\`)`+ };+ let http2WWW = {+ ...httpWWW,+ service: `${serviceId}-http2`,+ rule: `${rule} && HeadersRegexp(\`Content-Type\`, \`application/grpc*\`)`+ };+ let https2 = {+ ...https,+ service: `${serviceId}-http2`,+ rule: `${rule} && HeadersRegexp(\`Content-Type\`, \`application/grpc*\`)`+ };+ let https2WWW = {+ ...httpsWWW,+ service: `${serviceId}-http2`,+ rule: `${rule} && HeadersRegexp(\`Content-Type\`, \`application/grpc*\`)`+ };+ return {+ [`${serviceId}-${pathPrefix}`]: { ...http },+ [`${serviceId}-${pathPrefix}-http2`]: { ...http2 },+ [`${serviceId}-${pathPrefix}-secure`]: { ...https },+ [`${serviceId}-${pathPrefix}-secure-http2`]: { ...https2 },+ [`${serviceId}-${pathPrefix}-www`]: { ...httpWWW },+ [`${serviceId}-${pathPrefix}-www-http2`]: { ...http2WWW },+ [`${serviceId}-${pathPrefix}-secure-www`]: { ...httpsWWW },+ [`${serviceId}-${pathPrefix}-secure-www-http2`]: { ...https2WWW }+ };+ }return {[`${serviceId}-${pathPrefix}`]: { ...http },[`${serviceId}-${pathPrefix}-secure`]: { ...https },@@ -384,7 +430,8 @@ export async function proxyConfiguration(request: FastifyRequest<OnlyId>, remoteisHttps,isWWW,dualCerts,- isCustomSSL+ isCustomSSL,+ isHttp2)};traefik.http.services = {diff --git a/apps/client/src/routes/applications/[id]/+page.svelte b/apps/client/src/routes/applications/[id]/+page.svelteindex 1e1adbab2f..1bd70cfe49 100644--- a/apps/client/src/routes/applications/[id]/+page.svelte+++ b/apps/client/src/routes/applications/[id]/+page.svelte@@ -734,8 +734,8 @@id="isHttp2"isCenter={false}bind:setting={isHttp2}- title="Enable HTTP/2 (h2c only)"- description="Enable HTTP/2 protocol. <br><br>HTTP/2 is a major revision of the HTTP network protocol used by the World Wide Web that allows faster web page loading by reducing the number of requests needed to load a web page. <br><br>Useful for gRPC and other HTTP/2 based services."+ title="Enable h2c (HTTP/2 without TLS)"+ description="Enable h2c protocol. <br><br>HTTP/2 is a major revision of the HTTP network protocol used by the World Wide Web that allows faster web page loading by reducing the number of requests needed to load a web page. <br><br>Useful for gRPC and other HTTP/2 based services."on:click={() => changeSettings('isHttp2')}/></div>diff --git a/apps/ui/src/routes/applications/[id]/index.svelte b/apps/ui/src/routes/applications/[id]/index.svelteindex bae564c469..519518cd8a 100644--- a/apps/ui/src/routes/applications/[id]/index.svelte+++ b/apps/ui/src/routes/applications/[id]/index.svelte@@ -756,8 +756,8 @@id="isHttp2"isCenter={false}bind:setting={isHttp2}- title="Enable HTTP/2 (h2c only)"- description="Enable HTTP/2 protocol. <br><br>HTTP/2 is a major revision of the HTTP network protocol used by the World Wide Web that allows faster web page loading by reducing the number of requests needed to load a web page.<br><br>Useful for gRPC and other HTTP/2 based services."+ title="Enable h2c (HTTP/2 without TLS)"+ description="Enable h2c protocol. <br><br>HTTP/2 is a major revision of the HTTP network protocol used by the World Wide Web that allows faster web page loading by reducing the number of requests needed to load a web page.<br><br>Useful for gRPC and other HTTP/2 based services."on:click={() => changeSettings('isHttp2')}/></div>