Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proxyConfig is ignored #29759

Open
1 task done
cawoodm opened this issue Mar 5, 2025 · 1 comment
Open
1 task done

proxyConfig is ignored #29759

cawoodm opened this issue Mar 5, 2025 · 1 comment
Labels
needs: repro steps We cannot reproduce the issue with the information given

Comments

@cawoodm
Copy link

cawoodm commented Mar 5, 2025

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

No response

Description

ng serve --proxy-config proxy.conf.json is having no effect. There is no error message but no proxying is done.

The file proxy.conf.json exists and is in the same directory as the angular.json. Setting serve.options.proxyConfig in angular.json similarly has no effect. Calls to /api are not proxied, they are redirected back to / as if no proxying was active. There is also no message in the console that ng serve is now proxying.

proxy.conf.json

{
  "/api": {
    "target": "http://localhost:7071/api",
    "secure": false
  }
}

Minimal Reproduction

Run ng serve --port 7073 --proxy-conf or ng serve --proxy-conf proxy.conf.json (the docs are ambiguous).
Call http://localhost:7073/api - expect it to be proxied to localhost:7071 but it just redirects back to /

Exception or Error


Your Environment

Angular CLI: 19.1.8
Node: 22.7.0
Package Manager: npm 10.8.2
OS: win32 x64

Angular: 19.1.7

Anything else relevant?

No response

@alan-agius4
Copy link
Collaborator

Hi @cawoodm, I am unable to replicate this problem. Can you setup a minimal repro please?

You can read here why this is needed. A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.

This might be related to your directory structure so its really important to get an accurate repro to diagnose this.

@alan-agius4 alan-agius4 added the needs: repro steps We cannot reproduce the issue with the information given label Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: repro steps We cannot reproduce the issue with the information given
Projects
None yet
Development

No branches or pull requests

2 participants