Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
    
thanks,how can i close the question,i new here – mlzboy Jan 25 '11 at 1:59
    
Click the check mark under the answer that was the best. – Martin Fjordvald Jan 25 '11 at 1:59
server {
    listen www.domain.com:8080;
    server_name  www.domain.com;
    rewrite ^ http://www.domain.com permanent;    
}

Should do it.

share|improve this answer
    
Unless you really need the extra folder path - /xxx/index.html – Jon Rhoades Sep 14 '10 at 2:34
1  
in which case rewrite ^ domain.com$request_uri permanent; would do it. – Martin Fjordvald Sep 14 '10 at 12:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.