I Have a problem with nginx configuration. If user agent is "robot" - then proxy pass to another port with setting corrent uri as argument
for example : have two services localhost:5000 and localhost:6000 port all non robots pass to 5000 and robots pass to 6000 with url like :
normal https://test.page/test/test -> http://localhost:5000/test/test
robot https://test.page/test/test -> http://localhost:6000/Page/Get?url=https://test.page/test/test
i try like this :
if ( $http_user_agent ~ 'robot' ) {
set $request_uri "/Page/Get?url=https://test.page$request_uri";
proxy_pass http://localhost:6000;
}
if ( $http_user_agent !~ 'robot' ) {
proxy_pass http://localhost:5000;
}
but for robot got 404