Welcome! Log In Create A New Profile

Advanced

Re: Reverse proxy redirection issue

Francis Daly
September 20, 2021 12:50PM
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 http://4.DOMAIN.edu.ar
>
> Returns a redirect to https://4.DOMAIN.edu.ar

Ok, so that much is doing what is wanted.

> But
>
> curl -i https://4.DOMAIN.edu.ar
>
> Returns a redirect to https://4.DOMAIN.edu.ar

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

When you request https://4.DOMAIN.edu.ar, 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 4.DOMAIN.edu.ar;

> 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 Host:4.DOMAIN.edu.ar 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.

Cheers,

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

Reverse proxy redirection issue

drodriguez September 17, 2021 09:26PM

Re: Reverse proxy redirection issue

Francis Daly September 18, 2021 04:04AM

Re: Reverse proxy redirection issue

drodriguez September 18, 2021 08:18AM

Re: Reverse proxy redirection issue

Francis Daly September 19, 2021 03:02AM

Re: Reverse proxy redirection issue

drodriguez September 19, 2021 09:10PM

Re: Reverse proxy redirection issue

drodriguez September 20, 2021 10:04AM

Re: Reverse proxy redirection issue

Francis Daly September 20, 2021 12:50PM

Re: Reverse proxy redirection issue

drodriguez September 20, 2021 04:22PM

Re: Reverse proxy redirection issue

Francis Daly September 21, 2021 08:24AM

Re: Reverse proxy redirection issue

drodriguez September 21, 2021 09:06AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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