Welcome! Log In Create A New Profile

Advanced

rewrite ssl proxy retain query string parms

Mark Lybarger
August 13, 2020 07:00AM
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 ;
}

location /client/service/foo/ {
proxy_buffering off;
proxy_cache off;
proxy_ssl_certificate
/etc/ssl/certs/client-service-foo-cert.pem;
proxy_ssl_certificate_key /etc/ssl/certs/client-service-foo.key;
proxy_pass https://client-service-host/client/service/;
proxy_ssl_session_reuse on;
proxy_set_header X-Proxy true;
proxy_set_header Host $proxy_host;
proxy_ssl_server_name on;
proxy_set_header X-Real-IP $remote_addr;
}
_______________________________________________
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: 46
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