Hi, I don't think so, it should always be the first field of the URI but it would be a random string. I have to proxy pass and rebuild the new URI based on location at the original URI only.
Could you think of a way to do this? Thanks so much, Meir On Wed, Sep 11, 2019 at 5:46 PM Francis Daly <fran...@daoine.org> wrote: > On Wed, Sep 11, 2019 at 04:45:21PM +0200, meir hazon wrote: > > Hi there, > > > I would also like to pass the message to the proxy without the first part > > of the URI but use the rest of it. > > http://nginx.org/r/proxy_pass > > includes the section: > > """ > If the proxy_pass directive is specified with a URI, then when a request > is passed to the server, the part of a normalized request URI matching > the location is replaced by a URI specified in the directive: > location /name/ { > proxy_pass http://127.0.0.1/remote/; > } > """ > > With that sample config, you want two "location"s: > > > https://yyy.com/bla/aa/er > > if $1 == bla proxy pass to http://xxx.com/aa/er > > if $1 == vv proxy pass to http://ccc.com/aa/er > > "/name/" == "/bla/"; "/remote/" == "/". > "/name/" == "/vv/"; "/remote/" == "/". > > Does that work for you? > > f > -- > Francis Daly fran...@daoine.org > _______________________________________________ > 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