Skip to content

sockjs error when using deploy-url, base-href build options #25972

Closed

Description

@jtal

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:

Current behavior

After setting deployUrl and baseHref, a repetitive 404 (Not Found) error is produced in the browser. Something appears to be requesting /sockjs-node/info without considering deployUrl/baseHref.

Expected behavior

The request should be made to $deployUrl/sockjs-node/info. No 404 errors.

Minimal reproduction of the problem with instructions

  1. Create & serve an app:

ng new my-app
cd my-app
ng --deploy-url "/myapp/" --base-href "/myapp/" serve

  1. Create a proxy for /myapp location (I'm using nginx):

location /myapp {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://localhost:4200;
}

  1. Open Chrome (and dev console) and visit http://localhost/myapp

What is the motivation / use case for changing the behavior?

A user wants their website to be made of multiple projects listening on different ports behind a proxy.

Environment


Angular version: 6.1.7


Browser:
- [x ] Chrome (desktop) Version 65.0.3325.146 (Official Build) (64-bit)
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: v10.8.0   
- Platform: Linux 

Others:

nginx version: nginx/1.10.3 (Ubuntu)
OS: Ubuntu 16.04.4 LTS

Thanks!

Activity

  1. trotyl commented on Sep 15, 2018

    @trotyl
    Contributor

    Please report the issue to https://github.com/angular/angular-cli, and provides the minimal reproduction.

  2. angular-automatic-lock-bot commented on Sep 14, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  3. locked and limited conversation to collaborators on Sep 14, 2019
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions