[英]How I can make that the request to 'api.mydomain.com:8000' redirect to IP for the EC2 instance
I have an api running in a EC2 instance in AWS in certain port (ej 8000). 我有一个在特定端口(ej 8000)的AWS的EC2实例中运行的api。 I have register a domain in bluehost provider.
我已经在bluehost提供程序中注册了一个域。
Currently my app is pointing to the IP that offer the EC2 instance, but I want to change to the domain in order to use like api.mydomain.com:8000. 目前,我的应用指向的是提供EC2实例的IP,但我想更改为域,以便像api.mydomain.com:8000这样使用。
I tried to create a configuration in the DNS zone of panel control in the bluehost account, but it does not work, I think the DNS type I have to use is the 'SRV record', but I tried some configuration but the cpanel dont take it. 我试图在bluehost帐户中的面板控件的DNS区域中创建配置,但是它不起作用,我认为我必须使用的DNS类型是“ SRV记录”,但是我尝试了一些配置,但是cpanel不接受它。
How I can make that the request to 'api.mydomain.com:8000' redirect to the EC2 instance's IP and the configurated port?. 如何使对“ api.mydomain.com:8000”的请求重定向到EC2实例的IP和配置的端口? Thank you
谢谢
通常,您将创建“ A”记录以将域名指向IP地址,而不是“ SRV”记录。
You can use a normal A record for api.mydomain.com and point that to your instances IP address. 您可以对api.mydomain.com使用普通的A记录,并将其指向您的实例IP地址。 You don't include the port anywhere in the DNS configuration.
您不会在DNS配置中的任何位置包含该端口。
If it was a website that was on port 8000 you would type api.mydomain.com:8000 in your browser url. 如果它是端口8000上的网站,则应在浏览器URL中键入api.mydomain.com:8000。
Make sure that your instances security group is open on port 8000, and that your instance is listening on port 8000. 确保实例安全组在端口8000上打开,并且实例在端口8000上侦听。
When you say "it didn't work", what do you mean? 当您说“它不起作用”时,您是什么意思? Where was there a failure?
哪里有故障?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.