1

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
2
  • Make it location /todomvc/ (with trailing slash)
    – Alexey Ten
    Apr 13, 2016 at 8:00
  • Thanks Alexey. I'll try it once I reach work. I'll keep you posted.
    – devwannabe
    Apr 13, 2016 at 13:49

0

You must log in to answer this question.

Browse other questions tagged .