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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ