我在aws上运行了一个Spring-boot应用程序,我打开了端口443,并且应用程序已配置为接收https请求,并且这样工作正常:
属性:
server:
port: 8443
ssl:
key-store: '/etc/letsencrypt/live/app.testapp.com/keystore.p12'
key-store-password: 'password'
keyStoreType: PKCS12
keyAlias: tomcat
security:
require-ssl: true
我刚在服务器上安装并配置了docker-compose的docker,从那时起,当我构建和部署应用程序时,我只能对我的端点执行http请求,https不起作用。如何为我的应用程序发布https请求?有人能帮助我吗?
Dockerfile:
FROM openjdk:8-jdk-alpine
EXPOSE 443
VOLUME /tmp
ADD target/testapp-0.0.1-SNAPSHOT.jar app.jar
RUN sh -c 'touch /app.jar'
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom -Drun.profiles=prod","-jar","/app.jar"]
搬运工-compose.yml:
version: '3'
services:
rabbitmq:
image: "rabbitmq"
hostname: "rabbitmq"
environment:
RABBITMQ_ERLANG_COOKIE: "SWQOKODSQALRPCLNMEQG"
RABBITMQ_DEFAULT_USER: "test"
RABBITMQ_DEFAULT_PASS: "test"
ports:
- "15672:15672"
- "5672:5672"
labels:
NAME: "rabbitmq"
testapp-backend-prod:
build: .
ports:
- "8443:8443"
depends_on:
- redis
- rabbitmq
redis:
image: redis
答案 0 :(得分:0)
您的服务器已配置为端口8443,而所有docker配置都配置为端口443.修复此问题应解决此问题。