Proxy localhost:port -> subdomain.localhost:another_port doesn't work #588
Replies: 8 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.
-
I'm having a similar issue as well. I've got my frontend and backend being served with separate server processes (they're written in different languages, so as much as I might want to, it's really not possible to integrate them) Both sides of my application are being proxied using nginx proxy manager. {
"/api": {
"target": "https://api.foo.bar",
"pathRewrite": {
"^/api": ""
},
"changeOrigin": true
}
} I then make a POST request to Is my configuration wrong? am I trying to do something unsupported? Seems a bit weird to me, having an api server running on a subdomain is a pretty common thing. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
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