Proxy localhost:port -> subdomain.localhost:another_port doesn't work #588
Replies: 7 comments
-
Has anyone found a solution to this issue yet? |
Beta Was this translation helpful? Give feedback.
-
Care to create a minimal working setup so it can be investigated? |
Beta Was this translation helpful? Give feedback.
-
Afterall I just started to proxy to another environment. So solution wasn't found |
Beta Was this translation helpful? Give feedback.
-
Is this helpful? |
Beta Was this translation helpful? Give feedback.
-
I've hit this as well. My path is correct for the target server. I can hit the same endpoint in Chrome ( Update: I needed to add |
Beta Was this translation helpful? Give feedback.
-
putting my local subdomains on hosts file solved the issue to me, not the best solution but ok |
Beta Was this translation helpful? Give feedback.
-
I have a similar issue but my subdomain is dynamic. I tried using router callback so that I can reuse original host (since it includes the subdomain that I need) and just swap out the port but in the end the value from the target options is being used either way. Do you guys have any ideas ? |
Beta Was this translation helpful? Give feedback.
-
Expected behavior
I have two running dev servers on localhost. I need to proxy a request from
localhost:4000
tosubdomain.localhost:3000
Actual behavior
On server launch I receive:
[HPM] Proxy created: / -> http://agent.localhost:3000
On request I see following message in console:
[HPM] Error occurred while trying to proxy request /config from localhost:4000 to http://agent.localhost:3000 (ENOTFOUND) (https://nodejs.org/api/errors.html#errors_common_system_errors)
And in a browser I receive following
504
response:Error occurred while trying to proxy to: localhost:4000/config
At the same time requesting that endpoint in Chrome works fine.
Setup
proxy middleware configuration
server mounting
Beta Was this translation helpful? Give feedback.
All reactions