Welcome! Log In Create A New Profile

Advanced

Re: rewrite with regex to use proxy_pass

June 30, 2017 06:10PM
If I'm not wrong the rewrite is applied only for the path, not for
querystring.
To parse the arguments using a regex use a map with $args as input or use
the $arg_ARGNAME to the rewrite.

On Jun 30, 2017 20:49, "Alexandre" <infos@opendoc.net> wrote:

> Do you have solutions for my problem ?
>
> Thank you very much.
>
>
> On Fri, 30 Jun 2017 08:18:50 +0200
> Alexandre <infos@opendoc.net> wrote:
>
> > Hello,
> >
> > I have a question, I wish I could parser a url and retrieve fields to
> > inject them to another server.
> >
> > However, I can not. Here is my test:
> >
> > URL :
> > http://mywebsite.net/folder1/folder2/hit.php?s=11111&s2=&p=
> home::index&x2=[box]&apvr=[5.0]&idclient=&na=&ref=
> >
> > location ~ ^/folder1/folder2/ {
> >
> > rewrite
> > ^/folder1/folder2/hit.php?s=11111&s2=&p=(.*)::(.*)&x2=[
> box]&apvr=[5.0]&idclient=&na=&ref= /index.php?arg1=$1&arg2=$2
> > break;
> >
> > proxy_pass http://myinternalsrv.localdom;
> > }
> >
> > In my test, I want to retrieve the pattern "home" and "index" but it
> > does not work. Would you have an idea?
> >
> > Thank you very much for your information.
> >
> > Alex.
> > _______________________________________________
> > nginx mailing list
> > nginx@nginx.org
> > http://mailman.nginx.org/mailman/listinfo/nginx
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

rewrite with regex to use proxy_pass

Alexandre June 30, 2017 02:20AM

Re: rewrite with regex to use proxy_pass

Alexandre June 30, 2017 02:50PM

Re: rewrite with regex to use proxy_pass

wandenberg June 30, 2017 06:10PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 280
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready