样式表不能在nginx虚拟机中工作 [英] Stylesheets not working in nginx virtual machine

查看:116
本文介绍了样式表不能在nginx虚拟机中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我绝望。我的样式表不工作。我不明白。当我尝试在Chrome中调试它们时,我得到:

i'm desperate. My stylesheets are just not working. I don't get it. When i try to debug them in Chrome I get this:

我从来没有遇到过这个问题。这让我疯狂。我只是将它们添加到html页面的< head> 部分:< link rel =stylesheethref =/ css /cry-with-me.css\">

I've never encountered this problem before. It's driving me crazy. I'm simply adding them in the <head> section of the html page: <link rel="stylesheet" href="/css/cry-with-me.css">

这些可怕的红点是什么意思?我的css是好的,因为当我更新风格住,它的工作原理。并且每次我添加一个新的样式表,网站确实使用的样式。但是,当我更新他们或对原始文件做一些修改,这个红点出现。也许它必须做一些与浏览器缓存,但我尝试使用隐身模式,打开其他浏览器,一切。

What should those awful red dots of doom mean? My css is fine, because when i update the style live, it works. And also every time i add a new stylesheet, the website does use the styles. But the moment i update them or do the slightest modification to the original file, this red dots appear. Maybe it has to do something with browser caching, but I tried using incognito mode, opening other browsers, everything.

也许解决方案是相当简单,但我不能为我的生活使它工作。或者它与我的nginx服务器设置有关? mmmm ....

Perhaps the solution is pretty straightforward, but i can't for the live of me make it work. Or does it have to do with my nginx server setup? mmmm....

推荐答案

我想出了(找到一个在互联网上的链接去),虽然我应该把它放在这里,跑进这里。结果是 sendfile (用于在一个文件描述符和另一个文件描述符之间复制数据)在虚拟机上运行时真的搞砸了(Virtualbox on所以你只需要进入nginx.conf文件,并将 sendfile 设置为 off

i figured it out (well, found a link on the internets to go about it) and though i should just put it here in case anyone runs into this. It turns out sendfile (which is used to copy data between one file descriptor and another gets really messed up when running on a virtual machine (Virtualbox on Vagrant, in my case). So you just have to go into the nginx.conf file and set sendfile to off. And don't forget to restart nginx after that.

这里是帮助我整理出来的文章:

http://jeremyfelt.com/code/2013/01 / 08 / clear-nginx-cache-in-vagrant /#comment-1846

Here is the article that helped me sort this out:
http://jeremyfelt.com/code/2013/01/08/clear-nginx-cache-in-vagrant/#comment-1846

这篇关于样式表不能在nginx虚拟机中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆