I am using NGINX as a reverse proxy for a Grafana server which is connected to Elasticsearch. Elasticsearch is not publicly accessible (currently) but I would like to have a link from Grafana to a specific document.
Currently, I have the following block:
location / {
proxy_pass http://localhost:3000;
...
}
And I would like to add another URL that would proxy from /id/1234 to the url http://localhost:9200/myindex/_doc/1234. But I only want it to be if the id is an integer.
How would I do that?
location ~ ^/id/[0-9]+?