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
gefragt vor 4 Jahren204 Aufrufe
1 Antwort
0

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

wonka
beantwortet vor 4 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen