我有一个问题,我想在Nginx上安装symfony2,框架已安装但未加载css,js,img.因此,我只查看没有样式的主页.我的安装:
server {
listen 80;
server_name symfony.dev;
root /home/vagrant/Workspace/symfony/web;
access_log off;
error_log /var/log/Nginx/symfony.dev-error.log error;
location / {
# try to serve file directly,fallback to app.PHP
try_files $uri /app.PHP$is_args$args;
}
location ~ ^/(app|app_dev|config)\.PHP(/|$) {
fastcgi_pass unix:/var/run/PHP5-fpm.sock;
fastcgi_split_path_info ^(.+\.PHP)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
}
}
include /etc/Nginx/mime.types;
在mime.types中存在css,js等.
请帮帮我!
提前Thnx
最佳答案
您必须执行以下命令才能将资产安装在Web目录中:
原文链接:https://www.f2er.com/nginx/532269.htmlPHP app/console assets:install