我正在尝试为2个不同的位置配置nginx。一世这是我的情况。
www.example.com位置:/var/www/example.com
example.com/panel位置:/var/www/example.com/panel
尝试使用:http://nginx.org/en/docs/http/ngx_http_core_module.html#try_files
location ^~ /root {
root /var/www/example.com;
index index.html index.htm;
}
location ^~ /root/react_app(or panel) {
root /var/www/example.com;
index index.html index.htm;
try_files $uri $uri/ /root/react_app/index.html;
}