Score:0

Have godaddy point to specific path on custom ip

ru flag

I have an ec2 machine running nginx. It has a lot of projects and typically I access it via:

https://ai.mydomain.com/myproject

One of these projects is spinning out to be separate. Assuming the ip was xxx.yyy.aaa.bbb, how would I get the godaddy to point there?

Specifically how would I get http://myproject.com to point to -> xxx.yyy.aaa.bbb/myproject

Also, if I have a letsencrypt cert for https://ai.mydomain.com, how would I have two certs on the machine for different domains?

Score:0
bd flag

Assuming by godaddy you mean the dns service this is not possible, because it is simply not part of the dns protocol and would not make sense at that level in the stack.

What you want is a reverse proxy or cdn. A reverse proxy makes the request on behalf of you, and have additional features like rewriting the request path, or contacting multiple origins based on some rules. All this is possible because it operates on the http(s) level but hides the origin servers as an implementation detail.

One such cdn is amazon cloudfront. There it is possible to specify origin path which cloudfront will then append to all requests.

Considering you have tagget the question with lets-encrypts i want to note that is not needed with aws cloudfront. AWS can generate a certificate for you to use with the cloudfront. This is quite cheap in the order of a few cents/month unless you have much traffic.

Here is the configuration where you need to specify origin path: enter image description here

Score:0
ru flag

In case this helps someone in the future, I solved this using nginx:

Specifically:

  1. have your dns point both domains to the same ip of your server
  2. set up two nginx server blocks: one for domain1.com and a second for domain2.com. Those server blocks should point to different locations for their root folders.
  3. if youre running react, angular, etc on some port (eg 3000), have the second sever block proxypass everything to that port either through the default / location or some custom location.

I loosely followed this article:

https://ubiq.co/tech-blog/configure-multiple-host-names-nginx/

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.