Reputation: 3213
How is it possible set a redirection on nginx? The thing that I need to achieve is to redirect an old domain to the new domain that is the server name. Trying to use rewrite I am getting problems because with it I need to set as server name the old domain and the new one on the rewrite.
Upvotes: 0
Views: 598
Reputation: 15110
server {
server_name old.example.com;
return 301 http://new.example.org/;
}
server {
server_name new.example.org;
location / {
...
}
}
Upvotes: 1
Reputation: 76
Try using the "proxy_pass example.newdomain.com:8080" directive in a server block config of the old host name.
Upvotes: 0