Table of Contents
All services deployed by Space Cloud can be accessed only from within the cluster. Its as if, they do not exist to the outside world.
Sometimes you might want to expose certain services or endpoints to the external world. This is especially true when you are hosting your frontend from within Space Cloud. To do this, we need to set up some rules in the
The recommended way to expose your endpoints is by using the GraphQL API for enhanced security and flexibility
Each routing rule needs to point towards a
target service. The target is the service you have deployed using Space Cloud.
Routing rules can be applied based on the
URL of the incoming request. You can use either or a combination of both to set up your routing rules.
By default, each security rule matches requests irrespective of their host field. To match requests from specific hosts only, check the
Allow traffic from specified hosts only option.
This allows you to insert an array of hosts you want the rule to match. The rule matches if any one of the hostname match.
You can use the
* keyword to match requests irrespective of the host field.
Url based matching consists of 3 parts -
URL / prefix and
match type option configures the URL matching scheme used. There can be two possible values:
URLto match with the prefix of the requests URL.
URLmatches the requests URL exactly.
rewrite is used to overwrite the prefix of the URL when enabled.
|Route Matching Type||Prefix||Rewrite||Target Host||Target Port|
An incoming request with the URL
/v1/foo/bar would result in Space Cloud making a request
HTTPrequest even if the incoming request was
URLof the incoming request only.