-1
我正在使用express来构建RESTful节点js API服务器,该服务器只应与具有动态IP地址的其他一组特定的其他服务器通信。拒绝来自任何其他域/服务器的请求的最佳方式是什么?只允许来自Azure上的Node JS应用程序的特定域的请求
我正在使用express来构建RESTful节点js API服务器,该服务器只应与具有动态IP地址的其他一组特定的其他服务器通信。拒绝来自任何其他域/服务器的请求的最佳方式是什么?只允许来自Azure上的Node JS应用程序的特定域的请求
您可以在您的应用程序中列出服务的IP,并在web.config
中配置IP Security。
E.G.
<system.webServer>
<security>
<ipSecurity allowUnlisted="true"> <!-- this line blocks everybody, except those listed below -->
<clear/> <!-- removes all upstream restrictions -->
<add ipAddress="83.116.19.53"/> <!-- block one IP -->
<add ipAddress="83.116.119.0" subnetMask="255.255.255.0"/> <!--block network 83.116.119.0 to 83.116.119.255-->
</ipSecurity>
</security>
</system.webServer>
否则,你可以参考App Service Environment。
有关Azure App Service安全性的更多信息,请参阅https://azure.microsoft.com/en-us/documentation/articles/app-service-security-readme/。
谢谢你的回应。但正如我所提到的,服务器具有动态IP地址。那么有什么办法可以使用域名而不是IP地址来配置? – sohel101091