【问题标题】:Spring Boot Restricit for Local Access [duplicate]本地访问的 Spring Boot 限制 [重复]
【发布时间】:2021-01-10 17:12:23
【问题描述】:

我在 Nginx 后面有一个 Spring Boot 应用程序,并将一组 API 公开为 https 服务。我的安全团队要求我确保运行 Spring Boot 应用程序的端口(例如 8080)仅通过 NGINX 进行接口,人们无法绕过 NGINX 并直接访问该服务。

一种方法是安装本地防火墙并阻止端口 (8080)。

Spring Boot 中是否有任何东西可以确保仅通过 localhost 或 127.0.0.1 进行接口和访问?

【问题讨论】:

标签: java spring-boot


【解决方案1】:

您可以在 application.properties 中使用server.address 将服务器仅绑定到 127.0.0.1。

参考https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html#server-properties

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-02-18
    • 2014-01-17
    • 2015-09-27
    • 1970-01-01
    • 2013-08-09
    • 1970-01-01
    • 2019-08-24
    相关资源
    最近更新 更多