Good morning,
I have a elastic beanstalk on AWS over a NGINX, the load balancer of beanstalk listen HTTP and HTTPS, and i have a SSL certificate for mydomain.
When trying to access my aplication in HTTP, i can login normally, but when i tried in HTTPS, i get this error from console of chrome:
Mixed Content: The page at 'https://myapplication.com.br/#!/login/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://myapplication-env.us-east-1.elasticbeanstalk.com/myapplication/login.json'. This request has been blocked; the content must be served over HTTPS.
I know that HTTPS can't load HTTP content, like login.json.
i would have to do a redirect like: when i try to access http://myapplication-env.us-east-1.elasticbeanstalk.com/myapplication/login.json i access from HTTP instead of HTTPS? Only in this URL call
I have to use HTTPS in my application, but some internal calls can be only in HTTP.
I tried do this, but don't work:
if ($request_uri = http://myapplication-env.us-east-1.elasticbeanstalk.com/myapplication/login.json) {
rewrite ^(.*)$ http://myapplication.com.br$1 permanent;
}
Any ideas?
Thanks!