amazon-web-services - server.servlet.context-path 无法在 AWS 环境中运行
问题描述
我刚刚在 AWS 弹性 beanstack 上托管了我的 springboot 应用程序(WAR),但发现了一个奇怪的问题
server.servlet.context-path= /app-name/api/v0
这在 localhost 上运行得非常好,但是在通过 aws 部署后它不起作用,但是所有 API 都在没有来自 AWS 的上下文路径的情况下工作:
例子 :
http://awsaddress.com/login -> its working, but it should like
http://awsaddress.com/app-name/api/v0/login -> its not working
解决方案
我知道这个线程很老,但我面临同样的问题。在我的情况下,解决方案是在 application.properties 中添加以下行:
server.contextPath = /artifactId
server.servlet.contextPath = /artifactId
推荐阅读
- python - “描述(Pandas)”多个变量为一个变量
- transloco - 如何在 Transloco Translate API 中获取范围值
- c - VS Code 构建任务找不到包含路径
- android - 编辑文本自动高度增量
- elasticsearch - ELASTICSEARCH - 过滤内部点击中的值
- sql - 在 Postgres 中计算按类别分组的创建数
- anaconda - 为 Julia 设置默认 conda 环境
- php - OCI8 没有在 linux centos 8(LAMPP 堆栈)的 PHPinfo() 中显示/加载
- python - 从新窗口返回到主窗口
- python - cv2 编辑的图像以错误的颜色保存