Welcome! Log In Create A New Profile

Advanced

Re: How to redirect to https when using load balancer in front of nginx

Palvelin Postmaster
September 05, 2019 03:56PM
> On 4 Sep 2019, at 18.32, j94305 <nginx-forum@forum.nginx.org> wrote:
>
> In order to redirect http to https, you have to define a listener rule in
> the ALB that redirects all traffic on port 80 to port 443 (of the ALB) with
> the original path and query parameters. The status code should be a 301
> (permanent redirection). That's the context between the client and the ALB.
>
> The certificate for the domain(s) will be installed in the ALB.
>
> The target group for the ALB would contain the http target (or be filled in
> by an auto-scaling group's members in case you have multiple targets from an
> auto-scaling group). Your application server would only see http requests
> coming from the ALB. You won't get any https requests.
>
> The important point about rewriting http requests (from the client
> perspective) to https requests (client perspective again) is to define that
> rule in the ALB, and make that rule redirect requests for all paths.

Yes, I believe this I have setup in ALB, as I tried to explain (poorly, maybe):

alb-my-server-com | HTTP:80
(1 rule)
Redirect to: https://#{host}:443/#{path}?#{query}
Status code: HTTP_301

The issue I outlined happens with nginx regardless.
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

How to redirect to https when using load balancer in front of nginx

Palvelin Postmaster September 04, 2019 05:16PM

Re: How to redirect to https when using load balancer in front of nginx

j94305 September 04, 2019 09:32PM

Re: How to redirect to https when using load balancer in front of nginx

Palvelin Postmaster September 05, 2019 03:56PM

Re: How to redirect to https when using load balancer in front of nginx

Palvelin Postmaster September 06, 2019 03:14PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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