How can use multi location and regex in nginx?

Please help me with nginx.conf that is regex and multi location.

When I create the nginx.conf with next location, proxy_pass works correctly:

location = /test-a-1-1 {
       proxy_pass http://test-a-1-1;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $real_remote_addr;
       proxy_redirect off;
   }

  location = /test-b-1-2 {
      proxy_pass http://test-b-1-2;
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $real_remote_addr;
      proxy_redirect off;
  }

But I have many locations and I want use multi location, but in this configuration i get the error –

test-b-1-2 could not be resolved (3: Host not found)

resolver 172.16.10.3
location ~ ^/(test-a-[0-9]-[0-9]|test-b-[0-9]-[0-9]) {
                set $test $1;
                proxy_pass http://$test;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_redirect off;
                }

Please help me with regex and multi locations.
Thank you.

Go to Source
Author: perrfect

Extract data from web with google script

I’m trying to use the function below (source) to avoid using importxml in Google Sheets:

function importRegex(url, regex_string) {
  var html, content = '';
  var response = UrlFetchApp.fetch(url);
  if (response) {
    html = response.getContentText();
    if (html.length && regex_string.length) {
      var regex = new RegExp( regex_string, "i" );
      content = html.match(regex)[1];
    }
  }
  Utilities.sleep(1000);
  return content;  
}

I want to extract stock prices and day change from Yahoo Finance, for example from: https://finance.yahoo.com/quote/TSLA/, but I can’t get the regex_string right. I have tried several strings but none seens to work. Some one can help me please?

=importRegex("https://finance.yahoo.com/quote/TSLA/", "<span class=""Trsdu(0.3s) Fw(b) Fz(36px) Mb(-4px) D(ib)"" data-reactid=""32"">(.*)</span>")

Go to Source
Author: Caseyblack999