-3

I'm trying to configure Nginx for 2 different locations. This is my scenario.

www.example.com 
location : /var/www/example.com

example.com/panel 
location : /var/www/example.com/panel 
Mahsa Hassankashi
  • 2,086
  • 1
  • 15
  • 25

1 Answers1

0

Try to use: 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;
}
Mahsa Hassankashi
  • 2,086
  • 1
  • 15
  • 25