Python Nginx和CSS问题

Python Nginx和CSS问题,python,css,nginx,uwsgi,corruption,Python,Css,Nginx,Uwsgi,Corruption,我已经使用uwsgi为python网站设置了一个本地Nginx服务器,配置如下 server { root /var/www/localhost/current; index index.html index.htm; server_name localhost; location /static { alias /var/www/localhost/current/static; } location / {

我已经使用uwsgi为python网站设置了一个本地Nginx服务器,配置如下

server {
    root /var/www/localhost/current;
    index index.html index.htm;
    server_name localhost;

    location /static {
        alias /var/www/localhost/current/static;
    }

    location / {
        include uwsgi_params;
        uwsgi_pass unix:/tmp/localhost.sock;
        uwsgi_param UWSGI_PYHOME /var/www/localhost;
        uwsgi_param UWSGI_CHDIR /var/www/localhost/current;
        uwsgi_param UWSGI_MODULE wsgi;
        uwsgi_param UWSGI_CALLABLE application;
    }

    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
       root /usr/share/nginx/www;
    }
}
uwsgi配置:

[uwsgi]
plugins=python
vhost=true
socket=/tmp/localhost.sock
当我对位于
/static
文件夹中的CSS文件进行更改时,我在浏览器中访问它时会得到以下信息:

CSS应该是这样的:

body {
    background-color: #002b36;
    position: relative;
    padding-top: 50px;
    color: #93a1a1;
}

如果我删除
color:#93a1a1我没有得到
\u0
字符。你知道这可能是什么吗?

上面没有提到,但可能应该提到。服务器正在VirtualBox中运行

由于这个on-serverfault,我添加了
sendfileoff
到已修复问题的
/static
配置

location /static {
    alias /var/www/localhost/current/static;
    sendfile off;
}

我知道这很傻,但你有没有试着删除它,然后在不粘贴的情况下键入它?@MohammadAbuShady一点也不傻,我有,这是我做的第一件事。问题看起来像是在
}
之后。你有没有试着在它之后标记每件事并删除它?CSS文件只包含上面的CSS和文件末尾的新行。里面没有别的东西。这可能是一个字符编码问题吗?这引发了一个问题,如果没有这个
sendfile
浏览器上检测到的css文件的
内容类型是什么?配置中没有
sendfile
内容类型是
text/css
,它也是
text/css
。我的意思是在浏览器中,就像在firebug或一些inspectorThat中一样,这正是我所指的。多亏了这一点,我们在javascript文件中也遇到了同样的问题。