Nginx reverse proxy regex help

Francis Daly francis at
Sun Sep 19 07:15:35 UTC 2021

On Sat, Sep 18, 2021 at 10:53:57PM -0400, blason wrote:

Hi there,

> Oh my bad those xxx. and sss consider those are single url. I just typed
> while creating this post randomly

It Will probably be helpful in any future mails if you consistently
replace any information that you want to keep secret.

Perhaps use something like "client-ip" or "client-name"; or "nginx-ip"
or "nginx-name" (or "nginx-name2", if there is more than one); or
"upstream-ip" or "upstream-name".

> Here are my error.log -
> 2021/09/17 11:23:09 [error] 9429#9429: *1814357 peer closed connection in
> SSL handshake (104: Connection reset by peer) while SSL handshaking to
> upstream, client:, server:, request: "GET
> /TestPage/ HTTP/1.1", upstream: "", host:
> ""

(Is the same as And if not, do you expect
a request for to be handled by the nginx server block with
server_name If not, then that's the first place to look
for the fix.)

> Wondering why this is making connection to host when my proxy_pass says
> https://<Host_name>

"Host_name" could resolve to anything; and what it resolves to can change
over time. nginx is telling you which specific IP address it was talking
to when this problem happened.

"Connection reset by peer" suggests that the upstream service did not
like some aspect of the request that nginx made to it.

Is the current IP address of, and is
that different from the IP that that name resolved to when nginx started?

What do you see if you try to talk to that service manually, from the
nginx server?

The output of something like

  curl -v

will probably be helpful -- that's not exactly equivalent to what nginx
does, but is usually a good starting point.

(If it shows a different IP address being connected to, then maybe that is
part of the problem.)


Francis Daly        francis at

More information about the nginx mailing list