Configure Instance Based Gateway

Configure instance based gateway

Instance based gateway is used when there is only one machine receiving the traffic. This is a good example of a single tesing server which contains the entire services required for your business.

After configuring, lightwing will be able to manage traffic going to the instance and it can also control start/stop of the instance based on the idle time configuration.

To configure an instance based gateway, follow the below instructions:

Add a new gateway

  • Navigate to Autostopping on the left menu
  • Click on Add gateway button
  • And choose Instance based
  • Click Next

Add a new instance based gateway

Configure gateway details

  • Name: Enter a DNS complaint name for the gateway. Name has to be unique among other gateways in the organization
  • Port: The port in which traffic will be received
  • Idle time: Idle time in minutes. When lightwing detects no traffic for the idle time, it will stop the instance
  • Filter: Filter text to select filters required for the gateway. Lightwing will evaluate filter text and forward traffic to the matching instance. Filter uses TOML format and allows filtering on various metadata like: id, tags, ip etc.

Configure gateway

Click on Save gateway to save the gateway configuration.

Testing gateway configuration

After saving a gateway, lightwing will generate unique URL. This URL can be accessed using web browser. If configured correctly, lightwing will redirect traffic to the target server. Lightwing will also start the server if it is not running and shuts it down once the idle period is reached.

For this example, lightwing autogenerated URL is: 1-staging1.gateway.lightwing.io. Running a curl command can confirm it is working:

> curl 1-staging1.gateway.lightwing.io

You can also configure a custom domain to the lightwing generated URL. Read Configuring custom domains for a detailed explanation.