我想使用react-router连接React网页(在/service/backoffice
中)。访问/backoffice
时,可以使用/backoffice/login
,但是/backoffice/login
刷新(F5)会引发404 Not Found。
我应该在nginx.conf
中修复它吗?
在nginx.conf
下面:
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name aaa.com;
include /etc/nginx/default.d/*.conf;
location / {
proxy_pass http://127.0.0.1:8080;
}
location /backoffice {
alias /service/backoffice;
#try_files $uri /index.html;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}