Skip to content

ng serve behind HTTPS reverse proxy is failing to call https://localhost:4200 #2123

Description

@jandsu

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

  1. ng new foo
  2. cd foo
  3. ng serve
  4. 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;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedLabel noting an issue which the team is looking for contribution from the community to fixtype: RFC / discussion / question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions