如何为 Rails 应用添加 IP 限制? [英] How can you add IP restrictions to your rails app?

查看:35
本文介绍了如何为 Rails 应用添加 IP 限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法向 rails 应用程序添加 IP 限制.某种类型的机架中间件,因此出于安全原因,只有设置的 IP 列表才能访问 rails 应用程序?

Is there a way to add IP restrictions to the rails app. Some type of rack middleware so only the set list of IPs can access the rails app for security reasons?

谢谢

推荐答案

使用此处描述的路由约束:http://guides.rubyonrails.org/routing.html#advanced-constraints.

Use a routing constraint as described here: http://guides.rubyonrails.org/routing.html#advanced-constraints.

这篇关于如何为 Rails 应用添加 IP 限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆