Reverse proxy redirection issue

Francis Daly francis at
Mon Sep 20 16:49:26 UTC 2021

On Sun, Sep 19, 2021 at 10:08:08PM -0300, Daniel Armando Rodriguez wrote:
> El 2021-09-19 04:00, Francis Daly escribió:

Hi there,

> Today I added a new domain, and the issue showed up again.
> curl -i
> Returns a redirect to

Ok, so that much is doing what is wanted.

> But
> curl -i
> Returns a redirect to

And that is a redirect loop, which is not what you want.

When you request, that should get to nginx,
which should make a http request to INTERNAL_IP and return the response.

> server {
>     listen 443 ssl http2;
>     server_name;

>     location / {
>        proxy_http_version  1.1;
>        #For Websockets and keepalive connections
>        proxy_set_header Upgrade           $http_upgrade;
>        proxy_set_header Connection        "upgrade";
>        #required when using Websockets
>        proxy_set_header Host              $host;
>        proxy_pass http://INTERNAL-IP/;
>     }

What response do you get if you start on the nginx server and run the command

    curl -v -H http://INTERNAL-IP/

? I'm not sure if the Connection header will make a difference here;
it is possible that some of the X- headers are specially handled by the
internal server; and maybe adding --http1.1 to the curl command line
will make a difference too.

The aim is to see how the internal server responds, to see if there is
an nginx-side config that can be made to make the end-user experience
more useful.

It is possible that the internal server logs, or the nginx debug log,
could give more detail; but the "curl" command is probably relatively
quick to run and interpret.


Francis Daly        francis at

More information about the nginx mailing list