Managing Elastic Beanstalk Domain Names: Difference between revisions

From Littledamien Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
[[Category:AWS]] [[Category:Web Development]]
== Overview ==
== Overview ==


Line 39: Line 38:
** Enter nameserver addresses listed with the Amazon Route 53 hosted zone.
** Enter nameserver addresses listed with the Amazon Route 53 hosted zone.
** Click the checkmark to save the changes.
** Click the checkmark to save the changes.
[[Category:AWS]][[Category:Web Hosting]][[Category:Web Development]]

Revision as of 12:40, 6 October 2018

Overview

The documentation at Your Elastic Beanstalk Environment's Domain Name (AWS Elastic Beanstalk Developer Guide) is straight forward and easy to follow.

Configuring Django

Add the allowed domain names to the ALLOWED_HOSTS list in main_app/settings.py.

Make sure to prepend all domain names with a dot (.). Otherwise requests to subdomains such as www. will result in a 400 error.

Configuring Amazon Route 53

  • Go to the AWS Route 53 management console > Hosted Zones
  • Create Hosted Zone button
    • Domain name: domain name including subdomain
    • Type: Public Hosted Zone
  • After saving the hosted zone, click on it to open up its properties.
    • Click Create Record Set button
      • Name: subdomain, e.g. www
      • Alias: Yes
      • Alias Target: Select an Elastic Beanstalk environment from the dropdown.
      • Routing Policy: Simple
    • Make sure to create a record set for the domain without any subdomain, e.g. "mydomain.com" with no leading "www." In this case leave the Name field blank and point it to the appropriate EB environment.

Configuring non-Amazon registrars

  • In Amazon Route 53, navigate to the hosted zone's record sets.
  • Find a list of name servers in the right column of the record with Type of "NS" ,
  • Copy those name servers to the name server setting of the domain name with the 3rd-party registrar.

What should happen at this point is that any requests for the domain name that the registrar receives will be automatically forwarded to Amazon's name servers, which will then follow the rules defined by the hosted zones in Route 53.

Namecheap settings

  • Log in at namecheap.com.
  • Go to Dashboard > Domain List > find the domain > Manage button > Domain tab
  • Under Nameservers select Custom
    • Enter nameserver addresses listed with the Amazon Route 53 hosted zone.
    • Click the checkmark to save the changes.