如何在nginx上设置重定向?我需要实现的事情是将旧域重定向到新域,即服务器名称。尝试使用重写时,我遇到了问题,因为在重写时,我需要将旧域名和新域名设置为服务器名称。
发布于 2012-11-07 20:11:50
server {
server_name old.example.com;
return 301 http://new.example.org/;
}
server {
server_name new.example.org;
location / {
...
}
}发布于 2012-11-07 08:36:33
尝试在旧主机名的服务器块配置中使用"proxy_pass example.newdomain.com:8080“指令。
https://stackoverflow.com/questions/13261567
复制相似问题