Welcome! Log In Create A New Profile

Advanced

Re: Nginx reverse proxy regex help

Francis Daly
September 18, 2021 03:52AM
On Fri, Sep 17, 2021 at 01:34:32AM -0400, blason wrote:

Hi there,

> I have server whose URL is https://xx.xx.xx.xx/TestPage/ which gets
> generated as
>
> https://xxxx.xxx.xxx/TestPage/(S(0inoxzi14rxqq1uix1tiyp1t))/index.aspx

You have a variety of .xx and .ss, and it's not immediately clear to me
which sets are the same and which sets are not.

If you use something like "one.example.com" and "two.example.com", or
"IP1" and "IP2", then if the problem is that you are using and unexpected
address, that might become obvious. Thanks.

I'm also not quite clear on what you mean by "which gets generated as".

Do you mean that if you make a request for
https://backend-server/TestPage/ it returns a http redirect to
https://backend-server/TestPage/(S(0inoxzi14rxqq1uix1tiyp1t))/index.aspx,
and you are then expected to make a new request for
https://backend-server/TestPage/(S(0inoxzi14rxqq1uix1tiyp1t))/index.aspx?

Or it is something else?

> Now I have implemented nginx reverse proxy in front this server and then I
> have done the config proxy_pass as
>
> proxy_pass https://xxx.ssss.sss.ss/TestPage;
>
> Now if you see after TestPage there is a unique value gets added and then
> index.aspx however whenever request is passed through nginx I get 502
> badgateway.

What does the nginx error log say about the 502 response?

> Wondering how do I pass that unique value through regex?

You should not need to do anything special, as you are using a
"prefix-match" location.

Because you are doing "proxy_pass https://", you may want to check what
the backend-server responds with when you make this request from the
nginx server -- if it is serving more than one site on the same ip:port,
you will want to be sure that it is using the site that you want it to
be using.

Cheers,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx reverse proxy regex help

blason September 17, 2021 01:34AM

Re: Nginx reverse proxy regex help

Francis Daly September 18, 2021 03:52AM

Re: Nginx reverse proxy regex help

blason September 18, 2021 10:53PM

Re: Nginx reverse proxy regex help

Francis Daly September 19, 2021 03:16AM

Re: Nginx reverse proxy regex help

blason September 19, 2021 08:25AM

Re: Nginx reverse proxy regex help

blason September 19, 2021 08:44AM

Re: Nginx reverse proxy regex help

blason September 19, 2021 10:24AM

Re: Nginx reverse proxy regex help

Francis Daly September 20, 2021 01:12PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 294
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