使用Route 53在域名集成中将端口号添加到弹性IP(Adding port number to Elastic IP in domain name integration using Route

编程入门 行业动态 更新时间:2024-10-11 21:22:20
使用Route 53在域名集成中将端口号添加到弹性IP(Adding port number to Elastic IP in domain name integration using Route 53)

我想将我的端口号添加到我的弹性IP中以集成到我的域中。但是它不允许添加端口。 它只允许我添加我的弹性IP。如何将我的端口添加到我的弹性IP? 比如,我的域名是www.xxyyzz.com ,我想将我的弹性IP xx.xx.xx.xx和我的端口:8888添加到该域名。 如果我运行www.xxyyzz.com,它将指向xx.xx.xx.xx:8888 。 我怎样才能做到这一点? 或者还有其他方法可以实现吗?

I want to add my port number to my Elastic IP to integrating into my domain.But it won't allow adding a port. It only allows me to add my Elastic IP.How can I add my port to my elastic IP? Like, my domain is www.xxyyzz.com and I want to add my Elastic IP xx.xx.xx.xx and my port:8888 to that domain name. If i run www.xxyyzz.com it will point xx.xx.xx.xx:8888. How can I achieve this? Or is there any other way to achieve it?

最满意答案

您应该使用反向代理作为nginx来执行此操作。 这不是DNS规则。

server { listen 80; server_name your-domain-name.com; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; proxy_pass http://X.X.X.X:8888; } }

Finally ,I solved the problem using iptables to redirect any request to my own port 8888. I used below command to redirect all the request fro 80 to 8888. Now it works fine.

sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8888

更多推荐

本文发布于:2023-07-26 06:29:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1271995.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:中将   弹性   端口号   域名   Route

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!