这是一个在Ubuntu下安装lnmp中的配置。php
当咱们须要引入js的时候,发现js和css,图片引不进来等,css
这里在确保代码彻底正确的状况下,还要配置nginx的配置文件。html
直接上代码吧!nginx
server { listen 80; listen [::]:80; server_name phalcon.dev; set $root_path '/var/www/html/public'; root /var/www/html; index index.php index.html; location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name; include fastcgi_params; } location /{ rewrite ^$ public/ last; rewrite ^(.*)$ /public/index.php?_url=$1 last; } location ~* ^/(css|img|js|flv|swf|download)/(.+)$ { root $root_path; } location ~ /\.ht { deny all; } }