问题
I have a create-react-app based React App. I am currently serving it using NGINX. I generated the build directory and serving it as a root in NGINX. My NGINX conf currently looks like this:
http {
server {
listen 80;
root /home/react-app/build;
index index.html;
location / {
try_files $uri /index.html;
}
}
}
However when I load the page, the JS and html files are loading. However the CSS is not being applied. Also, when I checked the network tab in browser developer tools, I see that the CSS files are properly being loaded with http status 200. However the CSS is not being applied. Please help me, this is bugging me since 2 days.
来源:https://stackoverflow.com/questions/64265060/nginx-server-not-applying-the-css-files