Here is how to create a self-signed wildcard certificate and route the app name via subdomain.
The goal is to hit a vanity domain named "http://tru-dev.mywebsite.com/best-app22/"
That should hit the DLB and resolve to a Cloudhub app that you uploaded to your VPC named "best-app22-api-tru-dev".
The DLB will use the URI to resolve the app's prefix, append "-api-", and finally add the subdomain "tru-dev" to the full string of the app name.
1) Save the contents of the script as aa.sh:
#!/usr/bin/env bash
# print usage
DOMAIN=$1
if [ -z "$1" ]; then
echo "USAGE: $0 domain.lan"
echo ""
echo "This will generate a non-secure self-signed wildcard certificate for given domain."
echo "This should only be used in a development environment."
exit
fi
# Add wildcard
WILDCARD="*.$DOMAIN"
# Set our CSR variables
SUBJ="
C=US
ST=NY
O=Local Developement
localityName=Local Developement
commonName=$WILDCARD
organizationalUnitName=Local Developement
emailAddress=
"
# Generate our Private Key, CSR and Certificate
openssl genrsa -out "$DOMAIN.key" 2048
openssl req -new -subj "$(echo -n "$SUBJ" | tr "\n" "/")" -key "$DOMAIN.key" -out "$DOMAIN.csr"
openssl x509 -req -days 3650 -in "$DOMAIN.csr" -signkey "$DOMAIN.key" -out "$DOMAIN.crt"
rm "$DOMAIN.csr"
echo ""
echo "Next manual steps:"
echo "- Use $DOMAIN.crt and $DOMAIN.key to configure Apache/nginx"
echo "- Import $DOMAIN.crt into Chrome settings: chrome://settings/certificates > tab 'Authorities'"
2) Edit the above certificate variable values to fit your org needs.chmod +x aa.sh
./aa.sh mywebsite.com5) Go to DLB page, create a DLB, and add a certificate. If you haven't created a VPC, please create one now and ensure that it is the "default VPC" and that the environment where the app is to be uploaded is there: link
curl http://tru-dev.mywebsite.com/best-app22/
{"hello owlrd": "ee"}
001121240

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.