I'm having an issue with nginx serving my static website files (CSS and JS) when you navigate to any route with more than one slash. For example, example.com/test works, but example.com/test/test will try and load the css/js from example.com/test/{.css|.js} instead of the root directory.
For context, I am using React and ReactRouter on this website.
nginx config
server {
listen 80;
server_name example.com;
root /var/www/example.com;
index index.html;
rewrite ^.*$ /index.html;
location / {
try_files $uri /index.html;
}
}
/in front.