Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 使用nginx对不使用查询字符串的web应用路由作出反应_Reactjs_Nginx - Fatal编程技术网

Reactjs 使用nginx对不使用查询字符串的web应用路由作出反应

Reactjs 使用nginx对不使用查询字符串的web应用路由作出反应,reactjs,nginx,Reactjs,Nginx,我正在尝试使用nginx托管我的react网站。除了具有查询字符串的路由之外,其他一切都可以正常工作 位置/{ 尝试使用文件$uri/index.html; } 请帮帮我。 谢谢最后,我得到了答案 我们可以通过两种方式实现这一目标 1. $查询字符串 位置/{ try_files$uri/index.html?$query_string; } 2. $是阿格斯吗 location/{ try_files$uri/index.html$is_args$args; } http:// exam

我正在尝试使用nginx托管我的react网站。除了具有查询字符串的路由之外,其他一切都可以正常工作

位置/{
尝试使用文件$uri/index.html;
}
请帮帮我。
谢谢

最后,我得到了答案

我们可以通过两种方式实现这一目标

1. $查询字符串
位置/{
try_files$uri/index.html?$query_string;
}
2. $是阿格斯吗
location/{
try_files$uri/index.html$is_args$args;
}
http:// example.com                          //works fine
http:// example.com/courses                  //works fine
http:// example.com/courses?type=software    //not working shows blank page.
http:// example.com/courses?type=software&institute=xyz    //not working shows blank page.