Welcome! Log In Create A New Profile

Advanced

Re: rewrite ssl proxy retain query string parms

Maxim Dounin
August 13, 2020 09:46AM
Hello!

On Thu, Aug 13, 2020 at 06:57:59AM -0400, Mark Lybarger wrote:

> I'm using rewrite to change some tokens in the url path, and am using ssl
> proxy to send traffic to a downstream server.
>
> if i post to https://myhost/start/foo/213/hello, the request gets to
> https://client-service-host/client/service/hello/213 using the needed
> certificate. great.
>
> my question is, how do i retain query string parameters in this example so
> that if i post(or get) using query strings, they get also used?
>
> https://myhost/start/foo/213/hello?name=world
> https://myhost/start/foo/213/hello?name=world&greet=full
>
> thanks!
>
> location ~ /start/(.*)/(.*)/hello {
> # $1 is used to pick which cert to use. removed by proxy pass.
> rewrite /start/(.*)/(.*)/(.*)? /client/service/$1/$3/$2 ;
> }

The configuration in question does not touch any query string
parameters, so they are retained by default.

Note that the rewrite directive retains request arguments by
default (and you can use a trailing '?' to remove them, see
http://nginx.org/r/rewrite).

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

rewrite ssl proxy retain query string parms

Mark Lybarger August 13, 2020 07:00AM

Re: rewrite ssl proxy retain query string parms

Maxim Dounin August 13, 2020 09:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 47
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready