# Proxy Pass | Upstream with query\_string

**URL:** <https://www.ruby-forum.com/t/proxy-pass-upstream-with-query-string/244671>\
**Category:** NGINX\
**Created:** [May 24, 2016, 4:18pm UTC](https://www.ruby-forum.com/t/proxy-pass-upstream-with-query-string/244671 "2016-05-24T16:18:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [May 24, 2016, 4:18pm UTC](https://www.ruby-forum.com/t/proxy-pass-upstream-with-query-string/244671/1 "2016-05-24T16:18:18Z")

</div>

I need to use proxy\_pass directive for the upstream server which has  
query\_string, which allows it to authenticate to the upstream server.  
How  
can i ensure that query string is pass-on with every request that goes  
via  
this reverse proxy.

My simplified configuration is

location /RetrieveProductWS {  
proxy\_pass  
[https://apiserver/secure/v1.0/retrieveProductConditions?client\_id=111-aaaa-2bbb&client\_secret=aaaaabbbbbbccccddd](https://apiserver/secure/v1.0/retrieveProductConditions?client_id=111-aaaa-2bbb&client_secret=aaaaabbbbbbccccddd)

Please suggest possible way to achieve this requirement.

Posted at Nginx Forum:

> **[Proxy Pass | Upstream with query\_string](https://forum.nginx.org/read.php?2,267095,267095#msg-267095)**
>
> I need to use proxy\_pass directive for the upstream server which has query\_string, which allows it to authenticate to the upstream server. How can i ensure that query string is pass-on with every request that goes via this reverse proxy. My...

---

<div class="post-metadata">

**Author:** ![hbajaj2](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/58f4c7/32.png) [@hbajaj2](https://www.ruby-forum.com/u/hbajaj2)\
**Post date:** [May 24, 2016, 6:44pm UTC](https://www.ruby-forum.com/t/proxy-pass-upstream-with-query-string/244671/2 "2016-05-24T18:44:56Z")

</div>

On Tue, May 24, 2016 at 10:17:55AM -0400, hbajaj2 wrote:

Hi there,

> I need to use proxy\_pass directive for the upstream server which has  
> query\_string, which allows it to authenticate to the upstream server. How  
> can i ensure that query string is pass-on with every request that goes via  
> this reverse proxy.

proxy\_pass ([Module ngx\_http\_proxy\_module](http://nginx.org/r/proxy_pass)) allows you to build the host,  
port and uri to request, using variables.

Probably you can use that to arrange what you want.

What request does the client send to nginx? What request should nginx  
send to its proxy\_pass upstream?

When you know that, it may be more obvious what proxy\_pass configuration  
to use.

Good luck with it,

## f

Francis D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
