We were hosting a site on github pages that needed to use cartodb.js and maps from our self-hosted cartodb server. Because github pages serves over https, there were mixed content errors when doing api calls to cartodb over http.
Adding ssl certificates to the nginx service on the docker host machine worked fine, but because the https traffic hitting nginx is just proxied to the cartodb services that are still running on http internally, the cartodb server is embedding http urls in some of its resources. This will lead to mixed content errors when using the cartodb app.
2 things had to be done to fix it:
- Edit cartodb/app/models/user/user_decorator.rb line 100, replace
base_url: public_url,
withbase_url: public_url.sub('http','https'),
This will update the user_data.base_url
global which cdb.js uses to build many of the api calls.