shravanghongade
Jun 13, 2022Nimbostratus
How to add/configure (redirect the request to another server) server which is not the backend?
How to add/configure (redirect the request to another server) server which is not the backend?
I have configured the backend with the Nginx server as a load balancer and added two backend server instances that run fine, but now the backend servers are calling other servers but requests getting failed cause Nginx is not able to recognize the backend of backend servers.
This is below architecture.
Sorry for my late reply, I was off my work and had no access to this board.
Do you only need to proxy any of those file servers whatever backendserver was choosen or do you need to take fileserver 1 when backendserver 1 was choosen?
Otherwise you can simply go with this, or did I missunderstood something?
upstream nginxlb { server 10.3.0.7; server 10.3.0.14 backup; } upstream fileservers { server 10.3.0.20; server 10.3.0.30 backup; } server { listen 80; server_name 10.3.0.16; add_header Access-Control-Allow-Origin *; location /file/path { proxy_pass http://fileservers; proxy_set_header Host $host; } location / { proxy_pass http://nginxlb; proxy_set_header Host $host; } }