如何改变一个EC2实例的默认端口

编程入门 行业动态 更新时间:2024-10-26 10:40:03
本文介绍了如何改变一个EC2实例的默认端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有在端口3000上运行(我想或任何端口为此事)Rails应用程序中,我可以通过浏览到公网IP,像这样访问: 1.2.3.4:3000 但我想只是省略端口数达到相同的页面,因为我的域名注册商只允许公网IP,没有端口号。是否有一个设置的地方,将所有传入流量从网站到指定的端口?

I've got a Rails application running on port 3000 (or any port I want for that matter) and I can access it by browsing to the public ip like so: 1.2.3.4:3000 but I would like to reach the same page by simply omitting the port number, since my domain registrar only allows the public ip, and no port number. Is there a setting somewhere to direct all incoming traffic from the site to a specific port?

推荐答案

有一些方法可以做到这一点:

There are a number of ways to do this:

  • 告诉Rails使用端口80本身(见这里)
  • 使用iptables来所有80端口的流量转发到3000(见这里)
  • 在您的面前用ELB情况下,端口映射,从80到3000(请参阅这里)
  • tell rails to use port 80 natively (see here)
  • use iptables to forward all port 80 traffic to 3000 (see here)
  • front your instances with ELB, and port map from 80 to 3000 (see here)

更多推荐

如何改变一个EC2实例的默认端口

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

发布评论

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

>www.elefans.com

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