I would like to create a fallback route (*
) with the Swisscom CloudFoundry solution. My current applications are all mapped to a URL like this:
https://sample-application.scapp.io
When an application is deploying or stopped, I'm getting a 404
routing error:
404 Not Found: Requested route ('sample-application.scapp.io') does not exist.
I want to prevent this, by falling back to another application. Using *
as the host should define such a fallback route (see docs). Deploying the fallback application with the following manifest, however, throws an error:
Manifest:
---
path: .
instances: 1
buildpack: nodejs_buildpack
applications:
- name: fallback-app-165615
domain: scapp.io
host: '*'
memory: 128M
disk_quota: 1024M
Error:
Erstellen von Route *.scapp.io... OK
FEHLGESCHLAGEN Serverfehler, Statuscode: 400, Fehlercode: 210003, Nachricht: The host is taken: *
As it is obvious, that *.scapp.io
might be unavailable, I still would like to reroute my offline applications to a fallback page. Is this possible by using a second subdomain (e.g. my-application.company-name.scapp.io
) or is there any other way to achieve this?
You cannot achieve this when using a shared domain (shared domains are domains provided by your service provider). But you can easily do this by using your own domain. e.g. my-app1.my-domain.com -> *.my-domain.com or you can use a subdomain on your own domain: e.g. my-app.clolud.my-domain.com -> *.cloud.my-domain.com
If you want to stick to the shared domain you can use route services to achieve the error page. https://docs.cloudfoundry.org/services/route-services.html