Closed
Description
Running ng serve
behind an HTTPS reverse proxy is making requests on https://localhost:4200 when it should make them on http://localhost:4200
OS?
Ubuntu 16.04
Versions?
$ ng --version
angular-cli: 1.0.0-beta.11-webpack.9-4
node: 6.5.0
os: linux x64
Repro steps
ng new foo
cd foo
ng serve
- Then I load the page on https://mywebserver.mydomain.org which is the page served by a reverse proxy
==> observe the network tab in Chrome developer tools, it keeps making requests on
https://localhost:4200/sockjs-node/info?t=1473926195156
which fail when the same URL starting with http:// works
I have an HTTPS reverse proxy in front (to be able to route API calls - it needs to be HTTPS because I use the geolocation API). Here is an excerpt of the NGINX configuration file.
$ cat /etc/nginx/sites-enabled/my-test
server {
listen 443 ssl;
location / {
proxy_pass http://localhost:4200;
}
ssl_certificate /etc/nginx/ssl/myserver.crt;
ssl_certificate_key /etc/nginx/ssl/myserver-private.key;
}