【发布时间】:2016-04-01 01:26:21
【问题描述】:
我在 Spring Boot 中实现了一个 hello world。
我正在使用嵌入式 tomcat,这是我在 application.properties 中的设置。
server.contextPath=/test
server.port=8080
我可以通过[localhost:8080/test/index.html] 毫无问题地访问它。
但是,我将jar文件上传到数字海洋上的ubuntu 14.04并正常启动后,我无法通过[machine-ipaddress:8080/test/index.html]访问它。它给了我一个 404 错误。
我可以看到应用程序正在监听端口。
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 4284/java
我检查了 iptable 设置,没有被阻止。
我也尝试停止此操作并在远程服务器上运行常规的空 tomcat,访问[machine-ipaddress:8080] 没有问题。
欢迎任何想法。
【问题讨论】:
标签: java spring tomcat spring-boot