How to fix 404 error for proxy_pass using rewrite?

46 Views Asked by At
location /projects/test/2.0.0 {
#  modsecurity on;
  rewrite ^/(.*) /projects/test/2.0.0$request_uri break;
  proxy_pass http://10.1.0.6:3000/;
}

At http://10.1.0.6:3000; statics react, I get an html file.

It needs css and js at /static/js/123.js.

It tries to get them at https://example.com/static/js/123.js

And they are available at https://example.com/projects/test/2.0.0/static/js/123.js

How can I set this up correctly so the file can get the resources it needs?

0

There are 0 best solutions below