I'm trying to proxy a certain rest endpoint on my linux api box to my windows box. Here's what I have right now.
My linux api box
...
location ~ ^/api/v0/roslyn(.*)$ {
resolver 8.8.8.8;
proxy_pass $scheme://my-windows-box.com/roslyn$1;
}
For example, I'd like to proxy the following url
http://my-linux-box.com/api/v0/roslyn?q=5
to
http://my-windows-box.com/roslyn?q=5
However, it seems to be missing the querystring, so the regex is failing?
I don't think you can match the args by regex, try this instead
location /api/v0/roslyn {
resolver 8.8.8.8;
proxy_pass $scheme://my-windows-box.com/roslyn$is_args$query_string;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With