保护 Rails 后端服务器免遭直接连接
这是为 Rails 应用程序提供服务的经典方案:前端是 80 端口上的 Apache(nginx 等),后端:其他一些端口上的 mongrel(thin、unicorn 等)集群(例如 3000、3001、3002...) 。
如何使后端服务器仅允许本地(来自前端)连接?
It is classical scheme of serving Rails application: frontend is Apache (nginx, etc) on 80 port, and backend : cluster of mongrel (thin, unicorn, etc) on some other ports (for example 3000,3001,3002...).
How make, that back-end servers allow only local (from frontend) connections?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用套接字连接,那么您肯定只能在本地。
之后你可以对某些服务器说只接受 127.0.0.0 请求。通过 Thin 的示例
-a 选项是:
一个好的做法是添加一些防火墙以避免任何地方到代理端口的所有连接。
If you use the connection by socket, you are sur to be only in local.
After you can say to some server to accept only 127.0.0.0 request. Byt example with thin
The -a options is :
A good practice too is to add some Firewall to avoid all connection by anywhere to your proxy port.