2016-03-20 14 views
0

nginxとsymfony 2を接続しようとしましたが、私の設定ファイルはこのフレームワークでは動作しません。Symfony 2での作業のためにNginxを設定してください

server { 
listen 80; 
server_name test.com www.test.com; 
access_log /var/log/nginx/test.access.log; 
error_log /var/log/nginx/test.error.log; 

location ~* \.(jpg|jpeg|gif|png|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|tar|wav|bmp|rtf|swf|ico|flv|txt|docx|xlsx)$ { 
    root /home/test/var/www/test.com/public_html/web; 
    index index.html index.php; 
    access_log off; 
    expires 30d; 
} 



location ~ /\.ht { 
    deny all; 
} 

location/{ 
    proxy_pass http://127.0.0.1:8080/; 
    proxy_set_header X-Real-IP $remote_addr; 
    proxy_set_header X-Forwarded-for $remote_addr; 
    proxy_set_header Host $host; 
    proxy_connect_timeout 60; 
    proxy_send_timeout 90; 
    proxy_read_timeout 90; 
    proxy_redirect off; 
    proxy_set_header Connection close; 
    proxy_pass_header Content-Type; 
    proxy_pass_header Content-Disposition; 
    proxy_pass_header Content-Length; 
} 

}ディレクトリに含まれるすべての静的ファイルについては


/home/test/var/www/test.com/public_html/web/css
または
/ホーム/テストは/ var/www /のtest.com/public_htmlの/ウェブ/ JS
リターンエラー403

私はstatiを取得してみてくださいこれは私がこの問題を解決する

+0

'/ホーム/テストは/ var/www /のtest.com/public_htmlの/ web'は次とそのすべてのサブディレクトリへのnginxのアクセスをしていますか? DIR /ホーム/テスト= 750から –

+0

許可、 しかし、私はthiseサーバー上のJoomlaには、いくつかのウェブサイトを持っているし、良い仕事 –

+0

は/home/test/var/www/test.com/public_html/webの権限は何があるのnginxの? 'ls -all/home/test/var/www/test.com/public_html/web' –

答えて

0

をtest.com/css/style.cssのようにCファイルには、URLを使用しています。
私はユーザーを追加するのを忘れましたwww - データ(nginxプロセス)グループテスト(テストは、あなたの家のdirの所有者のすべてのファイルです)。

関連する問題