I have nginx configured on server like below
localhost ~ elastic{
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
With this I go on http://nginx_host/elastic/something I reach http://localhost:5000/elastic/something.
But I want to change it such that by going on http://nginx_host/elastic/something I reach http://localhost:5000/something.
I have many other services running on this server using same configuration as above, therefore I cannot use a generic method to remove the first part of the path, it needs to be specifically to remove elastic from start. How can I do this?