So I have this Nginx configuration
location /todomvc {
proxy_pass http://s3bucket/testtarget/todomvc/;
}
Then I access it this way
http://localhost/todomvc
The index.html loads but the resources like javascript, css fails because of path issues.
An example entry in the index.html is like this
<script src="node_modules/todomvc-common/base.js"></script>
<script src="node_modules/react/dist/react.js"></script>
<script src="node_modules/react/dist/JSXTransformer.js"></script>
I opened up Chrome Dev tools to see why I'm getting 404s on the assets. I found out that it was requesting them like this
http://localhost/node_modules/todomvc-common/base.js
http://localhost/node_modules/react/dist/react.js
http://localhost/node_modules/react/dist/JSXTransformer.js
So I tried accessing it like this but was shocked, it still 404
http://localhost/todomvc/node_modules/todomvc-common/base.js
http://localhost/todomvc/node_modules/react/dist/react.js
http://localhost/todomvc/node_modules/react/dist/JSXTransformer.js
location /todomvc/
(with trailing slash)