仅限Spring Boot Webapp本地主机 [英] Spring Boot webapp localhost only

查看:75
本文介绍了仅限Spring Boot Webapp本地主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以关闭Spring Boot webapp使用的端口?当前,我可以从本地主机和本地网络中的其他计算机进行访问.目的是只能在本地访问Webapp.

Is there a way to keep the used port closed for a Spring Boot webapp? Currently, I can access from localhost and from the rest of the machines in the local network. The objective is to only be able to access the webapp locally.

推荐答案

好吧,除了设置防火墙之外,您还可以将服务器绑定到本地主机.

Alright, other than setting up a firewall, you can bind your server to localhost.

这是通过放置

server.address=127.0.0.1

在资源中的application.properties文件内部

Inside the application.properties file in resources

有关此值和其他允许值的说明,可以在以下资源中找到:(有关嵌入式服务器"的特定参数,请参见"嵌入式服务器配置(服务器属性)" "

Explanation about this and additional allowed values can be found in the following resource: (for "embedded server" specific parameters, see section "EMBEDDED SERVER CONFIGURATION(ServerProperties) "

在应用程序中允许使用值.属性

这篇关于仅限Spring Boot Webapp本地主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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