Url Nginx无重定向重写

Url Nginx无重定向重写,url,redirect,nginx,rewrite,Url,Redirect,Nginx,Rewrite,嗨,我对nginx重写有问题。 如果不进行http重定向301,我无法找到要重写的规则 http://slug-site-1.example.com?param=1.. -> http://example.com/multysite/slug-site-1?param=1.. 我的nginx重写是 server { listen 80; server_name serverName; location / { rewrite ^/$ myHttpUrl/multySite/slug-s

嗨,我对nginx重写有问题。 如果不进行http重定向301,我无法找到要重写的规则

http://slug-site-1.example.com?param=1.. -> http://example.com/multysite/slug-site-1?param=1..

我的nginx重写是

server {
 listen 80;
 server_name serverName;
 location / {
  rewrite ^/$ myHttpUrl/multySite/slug-site-1 last;
 }
}

你必须使用代理模块,但可能你想要一些不同的东西。是的,我想说一个代理传递可以做到这一点,但如果两个站点在同一台设备上,你可以切换到另一个根并进行重写,这就是你想要做的吗?是的,这是一个唯一的站点,但我的规则是将slug-sit-1.example.com重定向到example.com/。/slug-site1。