2013-10-07 31 views
0

我已經建立了與uwsgi本地的Nginx服務器的蟒蛇網站具有以下配置的Nginx和CSS問題

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 

當我修改我的CSS它位於/static文件夾中,我得到了下面當我訪問它在瀏覽器中的文件:

Bad CSS File

這是CSS應該是什麼樣子:

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

如果我刪除color: #93a1a1;我沒有得到\u0字符。任何想法可能是什麼?

+0

我知道這很愚蠢,但您是否試圖刪除它並鍵入它而不粘貼它? –

+0

@MohammadAbuShady並不傻,我有,這是我做的第一件事。 – Nalum

+0

這個問題看起來像'}'之後,你是否試圖在它之後標記所有東西並刪除它? –

回答

2

沒有提到上面,但可能應該有。服務器正在VirtualBox中運行。

感謝這個question在serverfault我已經sendfile off;/static配置已修復問題。

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

嗯,這種提出了一個問題,沒有這個'sendfile'瀏覽器上的css文件檢測到'content-type'是什麼? –

+0

配置中沒有'sendfile'的'content-type'是'text/css',並且它也是'text/css'。 – Nalum

+0

我的意思是在瀏覽器中,像在螢火蟲或一些檢查員 –