4

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?

1

1 Answer 1

7

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;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.