0

SETUP

Browser -----HTTPS----> (NGINX) Reverse proxy -----HTTP----> Flask / REST-X / Swagger / Blueprint

SCENARIO I can successfully access everything via 80 / HTTP When I access https://example.com/api/v1/ I receive the following error:

Failed to load API definition
Errors
 
Fetch error Failed to fetch http://example.com/api/v1/swagger.json
Fetch error Possible mixed-content issue? The page was loaded over https:// but a http:// URL was specified. Check that you are not attempting to load mixed content.

I have tried multiple proxy_set_header options without success. I know aspect of this is working, with:

proxy_set_header Host $host;

This successfully passes the hostname and I can see that taking effect on the page links.

The main setting is X-Forwarded-Proto $scheme but this hasn't worked.

I also used the ProxyFix middleware, but this should only be used if you can't change the reserve proxy.

I'm fresh out of ideas and googling the heck out of it. Very much option to suggestions or re-trying if needed.

Thank you in adv!

Bob Trial
  • 9
  • 3
  • Same question was asked and answered in https://stackoverflow.com/questions/47508257/serving-flask-restplus-on-https-server – alecgonzales May 28 '21 at 03:11

0 Answers0