Mediawiki redirect issue when nginx is behind varnish and listen to not 80

Hi

I hava migrated a mediawiki site to nginx server.Nginx listen to port 81
and is behind Varnish listen to 80.Varnish and Nginx on same
server.Seems
like the configuration used for the Nginx wiki have a redirect
issue.Visit
example.com index page will redirect to example:81.

Any ideas?