Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redirect location includes ":80" when X-Forwarded-Proto is https

Nginx terminates SSL for our app, communication between Nginx and app servers happens on port 8080, our app had no grails.serverURL set in config.

We had a regular redirect:

redirect uri: '/login'

But when accessed via HTTPS the redirect returned:

Location: https://domain.com:80/login

As a result browsers attempt to open SSL connections over port 80 and fail.

like image 910
Kevan Ahlquist Avatar asked Mar 14 '23 19:03

Kevan Ahlquist


1 Answers

Removing the X-Forwarded-Proto header from nginx.conf or adding X-Forwarded-Port (recommended) resolved the issue.

like image 105
Kevan Ahlquist Avatar answered Apr 01 '23 22:04

Kevan Ahlquist