Hey guys, I have problem, any one can help me?
So my problems is that when my proxy pass return error 500 I want redirect to another server with same data params
worker_processes 1;
daemon off;
env REDIS_MASTER_ADDRESS;
env REDIS_MASTER_PORT;
env REDIS_MASTER_DB;
master_process off;
error_log stderr info;
events {
worker_connections 1024;
}
http {
server {
listen 80;
charset utf-8;
location /bots {
set $proxy_addr '';
access_by_lua_file /home/config/routers/bots.lua; # it's will return a proxy pass value to $proxy_addr
proxy_pass http://$proxy_addr;
}
location /train-bot {
set $proxy_addr '';
access_by_lua_file /home/config/routers/train_bot.lua; # it's will return a proxy pass value to $proxy_addr
proxy_pass http://$proxy_addr;
}
error_page 500 502 503 504 /bots-redirect;
location /bots-redirect {
set $proxy_addr '';
access_by_lua_file /home/config/routers/errors.lua;
proxy_pass http://$proxy_addr;
}
}
}
So I want do some like this:
If my proxy pass to "/bots" fail I want redirect this failed request to another proxy pass
In this case my code redirect to corrent url "/bots-redirect" in another proxy pass, but without params.
How can I get/set this params to this request?