For some reason, Angular will send all requests via HTTP unless you have a lead / at the end of your requests. Even if the page itself is served via HTTPS.
For instance:
$http.get('/someUrl').success(successCallback);
But if you add a lead / everything will work as expected:
$http.get('/someUrl/').success(successCallback);
PS You did not solve it by adding index.php to the end. You solved this by adding / before index.php; -)
EDIT: The main reason for this problem is that Angular is viewing the actual headers from the server. If you have the wrong internal http data pass through https, there will still be http headers, and Angular will use them unless you add / at the end. those. if you have NGINX serving content via https but sending requests to Gunicorn to the backend via http, you may have this problem. The way to fix this is to pass the correct headers to Gunicorn, so your structure will be impressed by the service via https. In NGINX, you can do this with the following line:
proxy_set_header X-Forwarded-Proto $ Schema;
Danil source share