仅为localhost保护codeigniter restfull服务器

时间:2017-04-13 18:42:48

标签: php codeigniter

我正在使用https://github.com/chriskacerguis/codeigniter-restserver作为CodeIgniter项目。我的前端是一个angularJS应用程序。

我想保护其余服务(domain.com/api/[calls),因此它只能从服务器本身的'localhost'使用。 那可能吗?

所以我想要的是,网络服务器只接受来自我的前端(localhost)的调用,而不接受来自我的api直接调用url的另一个工具服务器。

我在rest.php中尝试了白名单api,这在我的localhost(XAMPP)上工作正常,但在生产服务器上没有。

使用键不是一个好主意,因为它是AngularJS,代码是可读的。

0 个答案:

没有答案