NGINX server not applying the CSS files

血红的双手。 提交于 2021-01-29 09:34:02

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!