Forum Discussion
How to add/configure (redirect the request to another server) server which is not the backend?
- Jun 17, 2022
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; } }
here is the below code snippet.
upstream nginxlb {
server 10.3.0.7;
server 10.3.0.14 backup;
}
server {
listen 80;
server_name 10.3.0.16;
add_header Access-Control-Allow-Origin *;
location / {
proxy_pass http://nginxlb;
proxy_set_header Host $host;
}
}
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;
}
}
- shravanghongadeJun 20, 2022Nimbostratus
Thank you.
It will suffice the requirements
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com