React webapp - each source file rendering index.html source

0

I have a react web application that builds to a "dist" directory containing all assets. I am using a ELB build with Node.js and nginx, all default settings. The app successfully starts however when I load the page, all of the page assets e.g. js and css files do not render.

Inspecting the source of these files, they do not fail to load, however the source of each returns the html source of the home page, rather than their respective css and js contents.

This indicates some sort of proxy or rewrite issue im guessing but have no idea how to resolve.

Appreciate any guidance.

UPDATE: I can see nginx and node running using 80 and 8081 respectivley:

tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 6962/nginx: master
tcp 0 0 0.0.0.0:8081 0.0.0.0:* LISTEN 7061/node

wonka
已提問 4 年前檢視次數 204 次
1 個回答
0

Turns out there was a problem with my react build and the static assets were not being served correctly.

wonka
已回答 4 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南