Node.js proxying made simple. Configure proxy middleware with ease for connect, express, browser-sync and many more. Powered by the popular Nodejitsu http-proxy.
Questions tagged [http-proxy-middleware]
241 questions
0
votes
1 answer
For load balancing which is preferable Node Clusters or using axios / http-proxy-middleware and Node container is dockerized
code here
axios for load balancing
I am trying out the concepts of load balancing and I am not sure which method is suitable and works well when I dockerize the Node application
I haven't tried any implementation and i'm having doubt which one to…

Bharath Subu
- 1
- 1
0
votes
0 answers
How can i forward traffic an app running in port 3000 to a subdomain name?
I have a NodeJS app running in port 3000 in an AWS Lightsail Bitnami instance. I have added a domain name (https://mydoaminname.com) to the server and I can access it with https://mydoaminname.com. I want to transfer my NodeJS applications to view…

Dmap
- 129
- 2
- 17
0
votes
1 answer
How to use http-proxy-middleware with express router in Nodejs
I am trying to use http-proxy-middleware in NodeJs. It is not working. I am working on node version 18.
const express = require('express');
const router = express.Router();
const { createProxyMiddleware } = require('http-proxy-middleware');
const…

user16968394
- 1
- 2
0
votes
0 answers
How to set up multiple proxies hot reload correctly?
I saw proxy-hot-reload example. This example shows how to hot reload the proxy configuration.
I have multiple proxy configurations:
config/proxy.js:
module.exports = {
"/api/cool": {
target: "http://jsonplaceholder.typicode.com",
…

Lin Du
- 88,126
- 95
- 281
- 483
0
votes
0 answers
Error proxying request + Nestjs API in Docker
I have a nestjs monorepo where I a have a gateway app that I built to handle all requests. When I use the project outside of docker I am able to query correctly however once I use docker-compose to run my project I get the following error
Error…

Jason McFarlane
- 2,048
- 3
- 18
- 30
0
votes
0 answers
Unable to proxy react front end to express using http-proxy-middleware
my express app serving static react front-end works ok when deployed on heroku.
Now I want to develop locally so I don't need to commit and push to see actual changes.
So I need to proxy the fetch from my front-end to my back-end as those run on…

user1859295
- 63
- 1
- 10
0
votes
1 answer
Does http-proxy-middleware always forward cookies along with the request?
I was setting up a nodejs api with 2 different react front ends and found that I kept running into CORS issues.
To get around this I created 3 servers. 2 for each of the front ends and 1 for the actual api server. My thoughts were that I would…

KAT
- 125
- 3
0
votes
2 answers
Use http-proxy-middleware with express to access a protected resource
I'm attempting to proxy a remote, protected resource.
The proxy doesn't work, so I'm guessing that I have not configured it correctly.
server.js:
const express = require('express');
const { createProxyMiddleware } =…

craig
- 25,664
- 27
- 119
- 205
0
votes
0 answers
Axios React cors issue on product
my third party axios requests works properly on local mode properly thanks to "http-proxy-middleware", but after i build and deploy it, axios requests gives homepage html as response.
setupProxy.js file
const { createProxyMiddleware } =…

Faruk
- 9
- 2
0
votes
1 answer
How do I generate custom response when proxy error in http-proxy-middleware
TLDR: how do I customize the "Error occurred while trying to proxy: localhost:3000/" in http-proxy-middleware?
I'm using the node package http-proxy-middleware as a proxy.
I have some patterns where I know that the proxying will fail.
Here is a…

Colin FAY
- 4,849
- 1
- 12
- 29
0
votes
0 answers
onProxyReq not called on Create React App project
I created a basic React project using CRA. I'm trying to configure a proxy using setupProxy.js. The proxy works, however all the "on" methods are not being called, such as onProxyReq.
My configration:
module.exports = {
webpack: {
…

Noy Oliel
- 1,430
- 3
- 13
- 26
0
votes
1 answer
ReactJS http-proxy-middleware request header not set properly
TL;DR: How to actually change a request header in http-proxy-middleware?
To get around some CORS errors I set up a local proxy using the http-proxy-middleware module. In addition to setting the mode of my request to "no-cors" I need to change an…

Anteino
- 1,044
- 7
- 28
0
votes
0 answers
http-proxy-middleware to IIS timing out after 120s
I have a GET call (long operation) from my front-end (angular code) to a webapi (hosted on IIS).
To fix some CORS issue, I had to change the routing so that the call goes from browser to node first and then get routed to IIS.
Before: browser -> iis…

Noel
- 83
- 2
- 2
- 8
0
votes
0 answers
React - 504 Gateway Timeout when proxying
I'm using http-proxy-middleware to proxy some requests.
I can proxy correct some APIs but I'm getting 504 in one of them.
I believe this has something to do with the network (corp laptop).
I've run all of these commands to make sure it's all set…

leonSantoz
- 11
- 3
0
votes
0 answers
Passthrough proxy returns 404 for one GQL server but passes request correctly for the other one
We've got some GQL endpoints that are unreliable. Plus, it would be nice to be able to test failure paths in my app. So I created a local passthrough proxy to send back some canned responses:
import {createProxyMiddleware} from…

jcollum
- 43,623
- 55
- 191
- 321