How to permanently redirect port 8080 URL to port 80 using nginx

Because of my carelessness, I put http://www.domain.com:8080/xxx/index.html on the internet. I don't want to lose that traffic, so i want to permanent redirect that url to http://www.domain.com/xxx/index.html Can nginx achieve this? thanks


server {
    listen www.domain.com:8080;
    server_name  www.domain.com;
    rewrite ^ http://www.domain.com permanent;    
}

Should do it.