I have setup my webserver as varnish -> nginx -> php-fpm.
nginx is listening on port 8080 as backend server for varnish. varnish is front end webserver. I have configured port_in_redirect off and server_name_in_redirect off in nginx. But this plugin redirecting to nginx's domain and port in authenticated redirect.
For example when I log in to http://www.domain.com. It redirect to domain.com:8080 . 8080 is only accessible on localhost. so user cannot login.