licode icon indicating copy to clipboard operation
licode copied to clipboard

Basic example behind proxy (insecure XMLHttpRequest to erizio controller)

Open gregorfelkar opened this issue 9 years ago • 1 comments

I have my proxy server (entry server) with nginx redirecting everything to multiple virtual mashines (so they are hidden behind proxy).

So my situation is that i have https://domainname.com pointing to http://<virtual-mashine-ip>:3001 (so https is pointing to http) and the basic page is displayed just right. But my problem occurs as basic example tries to connect to erizio controller which is on another port. I get mixed content message:

Mixed Content: The page at 'https://domainname.com/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://<virtual-mashine-ip>:8080/socket.io/1/?t=1496238362118'. This request has been blocked; the content must be served over HTTPS.

So my questions are:

  • where do i find configuration file and which part of it i have to change so it will be all https.
  • do i have to add another vhost file to nginx for controller? (pointing to port 8080)
  • how do i apply new config? how do i restart licode and basic example? (till now i tried to re-run ./scripts/initLicode.sh)
  • do i need to have ssl certs on the virtual mashine where licode is hosted? (currently they are stored only in proxy server)

Im using Ubuntu 14.04 and i installed licode from git as described in install guide.

gregorfelkar avatar May 31 '17 13:05 gregorfelkar

I found the solution. I added new subdomin to nginx https://sub.domainname.com pointing to http://<virtual-mashine-ip>:8080

Then in licode_config.js i changed in Erizion controller section.

/*********************************************************
 ERIZO CONTROLLER CONFIGURATION
**********************************************************/
...
// This configuration is used by the clients to reach erizoController
// Use '' to use the public IP address instead of a hostname
config.erizoController.hostname = 'sub.domainname.com'; //default value: ''    <- changed this
config.erizoController.port = 443; //default value: 8080                       <- changed this
// Use true if clients communicate with erizoController over SSL
config.erizoController.ssl = true; //default value: false                      <- changed this

// This configuration is used by erizoController server to listen for connections
// Use true if erizoController listens in HTTPS.
config.erizoController.listen_ssl = false; //default value: false
config.erizoController.listen_port = 8080; //default value: 8080
...

gregorfelkar avatar Jun 01 '17 08:06 gregorfelkar