Dmitry Dn
Dmitry Dn

Reputation: 13

Nginx + React fail to load resources

nginx conf

Hey. I have a problem with react. I use '/' path for client (some static html content), and '/panel' for example for another server using 1 domain. But i have errors which don't load my react page.

So on home location (http://localhost/) all good. http://localhost/panel - only 'react app' in title.

browser errors

Upvotes: 1

Views: 657

Answers (1)

Taxel
Taxel

Reputation: 4207

That's because your React app tries to load the CSS and JS from the root path. Configure the homePage field in package json to be

"homePage": "/panel"

Upvotes: 1

Related Questions