Nginx将所有重定向到子目录

时间:2019-10-14 05:07:56

标签: nginx nginx-location

我正在尝试将所有来自example.com的请求重定向到example.com/test,但是我一直在不断“网站将您重定向太多次”

我做了什么。

                ColumnSeries CL = new ColumnSeries();
                CL.IndependentValueBinding = new Binding("Name");
                CL.DependentValueBinding = new Binding("ActionValue");
                //set Foreground color to series
                Style styleSeries = new Style { TargetType = typeof(Control) };
                styleSeries.Setters.Add(new Setter(Control.BackgroundProperty, System.Windows.Media.Brushes.LightSteelBlue));
                CL.DataPointStyle = styleSeries;

有人可以教我如何实现这样的目标吗?

预先感谢

1 个答案:

答案 0 :(得分:0)

那是因为当您下次将其重定向到/ test时,它再次与location /块匹配。 location /与您的所有网址匹配。您需要做的是添加一个等号,使其与您的基本网址完全匹配。

location = / {
    return 301 /test;
}