[prev in list] [next in list] [prev in thread] [next in thread]
List: nginx
Subject: Re: Nginx rewrite issue
From: "OS_Killer" <nginx-forum () forum ! nginx ! org>
Date: 2022-02-20 19:40:05
Message-ID: 45fb848ab484f1c657f8b0b4651350d5.NginxMailingListEnglish () forum ! nginx ! org
[Download RAW message or body]
Arguments from the requests are not taken into account when nginx choosing
locations.
Try to use the 'map' directive instead.
For example:
=======
map $arg_target $backend {
'server1' 'server1';
'server2' 'server2';
default 'server1';
}
server {
listen 80;
location = /index.html {
proxy_pass http://$backend;
}
}
=======
https://nginx.org/en/docs/http/ngx_http_map_module.html#map
https://nginx.org/en/docs/http/ngx_http_core_module.html#var_arg_
Posted at Nginx Forum: https://forum.nginx.org/read.php?2,293708,293710#msg-293710
_______________________________________________
nginx mailing list -- nginx@nginx.org
To unsubscribe send an email to nginx-leave@nginx.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic