0

Hello I am in a situation and unable to figure out a solution. My client have 2 domains. One is running with a website and other with webservices from API directory. Now client wants to have both on a single domain. I have done that but i am unable to map the website and api directory both with ip address. For example, website is mapped on domain.com and web services on api.domain.com. my domains are purchased at GoDaddy and hosted at AWS amazon. How can I make them both working and also have them SSL certificate?

I have added A records for the domain and the sub-domain in Godaddy DNS manager and also configured both these domains using Virtual hosts on the AWS. My root website is working just fine, however, the sub-domain is taking me to the root website, but I need it to take me to the 'api' directory.

  • Your question does not make sense to me. What is the difference between web services and website here, and where does the IP address come into it? What AWS services are you using? – davidgo Sep 13 '19 at 04:14
  • The website is hosted on the root directory say public_html, while the webservices (API) to mobile app is hosted at 'API' directory. And pointed to api.domain.com DNS – Curious Developer Sep 13 '19 at 04:21
  • Apologies, but I think you don't know how much you don't know. Websites don't point to domains, the reverse is slightly closer to the truth. Directories are fairly arbitrary, and "AWS amazon" does not tell us anyhing. Are you using AWS EC2 instances, and if so how? Are you using AWS ELB? – davidgo Sep 13 '19 at 08:18
  • I am using AWS EC2 instance. I just updated my question and added information about what I am currently doing. – Curious Developer Sep 13 '19 at 10:16
  • My issue has been fixed now. – Curious Developer Sep 13 '19 at 11:21

1 Answers1

0

This should be straightforward and ServerFault will have lots of answers already. The technology you are looking for is either name-based virtual hosting and/or a reverse proxy. All the major HTTP servers can do both easily.

yadda
  • 1