2017-08-16 3 views
0

私はサブディレクトリでRainloopを実行しようとしています。 http://babylon/webmail。私はCSSを取得し、jsは認識されません。例えば:私が試したCSSとnginxによって認識されない画像:リソースはスタイルシートとして解釈されますが、MIMEタイプtext/htmlで転送されます

Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://babylon/webmail/rainloop/v/1.10.5.192/static/css/rainloop/v/1.10.5.192/static/css/app.min.css?standard". 

いくつかの可能な(しかしdidntの仕事)ソリューション:

  1. は "/etc/nginx/mime.typesが含まれます。" nginx.confにあります。
  2. 一部は、PHPのための場所がその部分を台無しにされる、と言うので、私はこの行を追加する必要があります

    fastcgi_split_path_info ^(+ PHP。。)(/.+)$; #この行

しかし、それでも動作しません。

  1. cssとjavascriptの新しい場所をrootで追加しますが、何も追加しません。

私の設定は、このいずれかです。(それが含まれたファイルである)

location ^~ /webmail { 
    root /srv/rainloop/public_html; 
    try_files $uri $uri/ /webmail/index.php?$query_string; 
    access_log /srv/rainloop/logs/access.log; 
    error_log /srv/rainloop/logs/error.log; 
    index index.php; 
    access_log /var/log/nginx/scripts.log scripts; 

    location ~ \.php$ { 
     #if (!-f $request_filename) { return 404; } 
     include fastcgi_params; 
     #fastcgi_split_path_info ^(.+\.php)(/.+)$; #this line 
     fastcgi_pass unix:/var/run/php5-fpm.sock; 
     fastcgi_index index.php; 
     #fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
     fastcgi_param SCRIPT_FILENAME /srv/rainloop/public_html/index.php; 
    } 

    location ~ /\.ht { 
     deny all; 
    } 

    location ^~ /webmail/data { 
     deny all; 
    } 
} 

答えて

1

私はそれはあなたの問題を解決することができると思います。

location ~ \.css { 
    add_header Content-Type text/css; 
} 
location ~ \.js { 
    add_header Content-Type application/x-javascript; 
} 
+0

@Sanan_Guliyev @sanan_Guliyev @sanan_Guliyev @sanan_Guliyevここでは、jsファイルとcssファイルの404を取得します。 "/var/www/html/rainloop/v/1.10.5.192/static/js/min/boot.min.js"に失敗しました "/ srv/rainloop/public_html/rainloop/v/1.10.5.192/static/js/min/boot.min.js "となります。これらの2つの場所の中にルートを追加しましたが、それでもパスを修正しません。 – Ruben

+0

私のために働いた! –

関連する問題