Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

ng serve not working behind reverse proxy basehref/servepath

Aperta
#27,576 6 commenti 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
angular, typescript

Direzione di ricerca

Inizia riproducendo la configurazione segnalata ng serve --host 0.0.0.0 --disable-host-check tramite l’URL inoltrata /proxy/4200/. Analizza in che modo le opzioni basehref e servepath influiscono sugli Angular node-resource URLs e sui reindirizzamenti, incluso il caso di /proxy/4200/ duplicato. Il lavoro è completato quando il server di sviluppo inoltrato carica queste risorse senza un percorso errato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area: @angular-devkit/build-angular devkit/build-angular:dev-server freq1: low needs: investigation severity3: broken type: bug/fix
Command

serve

Is this a regression?
  • Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was

before vite

Description

I provide remote training for Angular using VSCode in the browser.
It is no longer possible to use the vscode port forwarding to access the ng dev server as basehref and servepath combinations to not yield the correct result when @angular node resources are to be loaded. It works for all other assets/files in the project.

Minimal Reproduction

Use code-server oder vscode server access through web browser.

ng new
ng serve --host 0.0.0.0 --disable-host-check

Open the forwarded port, URL becomes f.e.
https://student01.remote-training.de/proxy/4200/

Exception or Error

No response

Your Environment
Angular CLI: 17.3.6
Node: 20.12.2
Package Manager: npm 10.5.0
OS: linux x64

Angular: 17.3.7
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1703.6
@angular-devkit/build-angular   17.3.6
@angular-devkit/core            17.3.6
@angular-devkit/schematics      17.3.6
@angular/cli                    17.3.6
@schematics/angular             17.3.6
rxjs                            7.8.1
typescript                      5.4.5
zone.js                         0.14.5
Anything else relevant?

I tried various configuration combinations using prebundle, basehref and servepath only to experience worse problems like beeing redirected to https://student01.remote-training.de/proxy/4200/proxy/4200/

Lingua principale
TypeScript
Stelle
27k
Fork
11.8k
Merge medio
16h 35m
PR unite (30g)
176

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di angular/angular-cli

Tutte le issue di angular/angular-cli

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.