Welcome! Log In Create A New Profile

Advanced

Change protocol for URL destination

February 10, 2017 06:48AM
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!
Subject Author Posted

Change protocol for URL destination

mzibit February 10, 2017 06:48AM

Re: Change protocol for URL destination

itpp2012 February 10, 2017 07:23AM

Re: Change protocol for URL destination

mzibit February 10, 2017 07:42AM

Re: Change protocol for URL destination

itpp2012 February 10, 2017 10:14AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 316
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready