How to permanently redirect port 8080 URL to port 80 using nginx
17,517
server {
listen www.domain.com:8080;
server_name www.domain.com;
rewrite ^ http://www.domain.com permanent;
}
Should do it.
Related videos on Youtube
Author by
Alex
Updated on September 17, 2022Comments
-
Alex over 1 year
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
-
Martin Fjordvald over 13 yearsClick the check mark under the answer that was the best.
-
-
Jon Rhoades over 13 yearsUnless you really need the extra folder path - /xxx/index.html
-
Martin Fjordvald over 13 yearsin which case rewrite ^ domain.com$request_uri permanent; would do it.