Skip to content

Swagger UI not working behind AWS ALB.  #46

@pitthecat

Description

@pitthecat

Hi there,

I setup the Allure server on an AWS EC2 instance behind an AWS ALB. The ALB listens on 443 and all requests for allure.my-domain.cloud are redirected (host based-routing) to the EC2 with Tomcat on port 8080. So the ALB acts as proxy and does the SSL termination.

At first I had a problem because I was redirected from HTTPS to HTTP and it didn't work. I could fix this by adding a redirect from 80 -> 443 on the ALB. This works quite well, expect for the fact that the Swagger ui iframe is blocked by Chrome, because of a mixed content (HTTP/HTTPS) warning.

Mixed Content: The page at 'https://allure.my-domain.cloud/ui/swagger' was loaded over HTTPS, but requested an insecure frame 'http://allure.my-domain.cloud/swagger-ui.html'. This request has been blocked; the content must be served over HTTPS.

This is my run cmd for the Allure server java -Dallure.server-base-url=https://allure.my-domain.cloud/ -jar allure-server.jar

When I connect directly (without SSL and ALB) to the EC2 instance (http://10.172.255.15:8080/ui/swagger), it works and I can see that Swagger generates the wrong server url.

image

With best regards

pitthecat

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions