- Newest
- Most votes
- Most comments
To add a subdomain to a Lightsail instance, you'll need to follow a two-step process: creating a DNS record for the subdomain and configuring your web server to handle the subdomain.
First, let's create the DNS record:
- Sign in to the Lightsail console.
- Go to the "Domains & DNS" tab.
- Select the DNS zone for your domain.
- Choose "Add record" in the DNS records section.
- For the record type, select "A record".
- In the "Subdomain" field, enter your desired subdomain (e.g., "blog" for blog.example.com).
- In the "Resolves to" field, enter the static IP address of your Lightsail instance.
- Save the record.
After creating the DNS record, you'll need to configure your web server to handle the subdomain. This process varies depending on your web server software (e.g., Apache, Nginx), but generally involves:
- Creating a new directory for your subdomain content within your Lightsail instance.
- Configuring a virtual host or server block for the subdomain, pointing to the new directory.
- Restarting your web server to apply the changes.
It's important to note that simply creating a directory within your Lightsail instance does not automatically make it accessible as a subdomain. You must configure your web server to recognize and serve content from that directory for the specific subdomain.
Remember to allow time for DNS changes to propagate, which can take up to 48 hours in some cases. After everything is set up correctly, your subdomain should be accessible and serving content from the specified directory within your Lightsail instance.
Sources
Point your domain to a Lightsail load balancer - Amazon Lightsail
Point a domain to your Lightsail instance using Amazon Route 53 - Amazon Lightsail
Route domain traffic to a Lightsail instance - Amazon Lightsail
Relevant content
asked 3 years ago
asked 3 years ago
- AWS OFFICIALUpdated 3 years ago
