current position:Home>Nginx configuring reactrouter browserhistory browserrouter

Nginx configuring reactrouter browserhistory browserrouter

2022-05-15 02:20:17Wang Haihu

Redirect root

server {
  ...
  location / {
    try_files $uri $uri/ /index.html
  }
}

Redirect to the specified directory

server {
  ...
  location / {
    root  /usr/local/nginx/html/name; //name  Is the path you want to specify 
    try_files $uri /index.html;
  }
}

 

copyright notice
author[Wang Haihu],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/132/202205120523333323.html

Random recommended