I am currently configured on nginx like given below upstream backend {
least_conn;
server 172.17.0.4 max_fails=2 fail_timeout=30s;
server 172.17.0.2 max_fails=2 fail_timeout=30s weight=2;
}
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://backend;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
}
}
I am looking for url rewrites like
eg: if someone comes on example.com/sample. we want to redirect to proxy_pass backend/new/1/sample
but when i am doing proxy_pass it is redirecting to but the url in the browser still showing as example.com/sample
it should show example.com/new/1/sample
how can i rewrite the url and show the url in the browser.
Thank you in advance
example.com/sampleto be proxied tobackend/sample(which you current config does) or tobackend/new/1/sample? - Ivan Shatsky