Adonis/Nginx proxied server redirect fail


#1

I’m trying to use single sign on for my application, which uses nginx as a reverse proxy. My proxied server can’t initiate client redirects because it’s not getting through Nginx.

I’m not sure how to correct this issue.

    location /* {
      proxy_pass http://localhost:4000/;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection 'upgrade';
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_cache_bypass $http_upgrade;

      proxy_intercept_errors on;
      error_page 301 302 303 307 = @handle_redirect;
  }

   location @handle_redirect {
	set $saved_redirect_location '$upstream_http_location';
	proxy_pass $saved_redirect_location;
  }

Using Adonis Ally:

//LoginController
await ally.driver(p.provider).redirect(); //Redirect does not work

Any help would be appreciated.