Skip to content

Create internal domain

Sebastian Szwed edited this page Sep 2, 2016 · 2 revisions

Create hosted zone in AWS

  1. Got to Hosted Zones in Route 53
  2. Click Create Hosted Zone
  3. Choose your internal domain name
  4. Change Type to Private Hosted Zone for Amazon VPC
  5. Select VPC ID where you want to have internal domain

  1. Click Create - It will automatically open details for newly created hosted zone
  2. Click Create Record Set
  3. Type * in Name field
  4. Set Type to A - IPv4 address
  5. Enter NGINX EIP address to Value field

  1. Click Create

Create config for internal domain in NGINX

  1. Go to NGINX instance
  2. Create new config file in /etc/nginx/sites-available/ with this content:
server {
  listen 80;
  listen 443 ssl;
  server_name my.domain.internal *.my.domain.internal;
  allow 52.59.4.164/32;
  allow 52.59.130.131/32;
  deny all;

  location / {
    proxy_pass http://api;
    proxy_set_header Host $host;
  }
}

Where my.domain.internal is only example and you should change it to your internal domain.

  1. Create symbolic link to this file in /etc/nginx/sites-enabled/
ln -s /etc/nginx/sites-available/internal.conf /etc/nginx/sites-enabled/internal.conf

Where internal.conf is only example and you can name file differently.

  1. Reload NGINX
sudo service nginx reload

Add domain to Cloud Foundry

  1. Log in to Cloud Foundry CLI as user with admin privileges.
cf login
  1. Create domain:
  • shared (available in all organizations)

cf create-shared-domain my.domain.internal ```

  • private (available only in one organization)

cf create-domain org-for-my-internal-domain my.domain.internal ```

  1. Push app with specified your internal domain as domain in manifest.yml
Clone this wiki locally