kochetkov-ma / allure-server

Allure Server. Save/ generate / provide allure2 reports in one place
http://allure.iopump.ru
Apache License 2.0
218 stars 65 forks source link

Swagger UI not working behind AWS ALB. #46

Closed pitthecat closed 2 years ago

pitthecat commented 2 years ago

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

kochetkov-ma commented 2 years ago

Thank you very much for the investigation!

I actually encountered a similar problem a long time ago Now I need to prepare a stand to reproduce the problem to fix it. I'm afraid it won't be quick, as I'm busy with other projects right now, but I'll do it!

Thanks for your interest in the project!

pitthecat commented 2 years ago

Just to add some details

I can reach swagger directly by using https://allure.my-domain.cloud/swagger. Swagger still shows me the wrong generated server url (http://10.172.255.15:8080), but everything including API calls work fine.

So the problem is just the iframe when using https://allure.my-domain.cloud/ui/swagger as mentioned above.

kochetkov-ma commented 2 years ago

https://github.com/kochetkov-ma/allure-server/releases/tag/v2.11.1