How to add a route (alias) to an app using cf CLI
search cancel

How to add a route (alias) to an app using cf CLI

book

Article ID: 298248

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

You deployed an app on Tanzu Application Service for VMs (TAS for VMs) (app.domain.com). There is a DNS alias "www.app.domain.com" but you cannot connect on the "www" URL.

Environment

Product Version: 2.10

Resolution

To create a "www" alias for an app in a given ORG and SPACE, follow these steps:

1. Login to cf and target the org and space:
cf login
cf target -o ORG -s SPACE

2. Create a subdomain with the same name or route as the app:
cf create-domain ORG app.domain.com
cf create-route SPACE app.domain.com

3. Create a route with the -n (hostname) option, pointing to www.app.sampledomain.com:
cf create-route SPACE app.domain.com -n www