I have multiple domains as below: www.domain1.com www.domain2.fr www.domain3.com www.domain4.fr www.domain5.biz
I wanted to redirect specific requests coming to the any domain let's say traffic coming to www.domain1.com with specific parameter should be proxy_pass to domain1.domainabc.com
upstream backend {
server <server1 IP>:80;
server <server2 IP>:80;
}
server {
listen 80;
server_name www.domain1.com
server_name www.domain2.fr
server_name www.domain3.com
server_name www.domain4.fr
server_name www.domain5.biz
location / {
common confs
proxy_pass http://backend
}
location ~*/abc-xyz(.*) {
proxy_pass https://$domain.domainabc.com/abc-xyz/$1;
}
location ~/images/(.*) {
proxy_pass https://$domain.domainxyz.com/images/$1;
}
}
where $domain can be domain1, domain2, domain3 etc based on request coming to respective domains...
your earliest help would be apricated.
I tried multiple proxy_pass directtive but could not make it work.