Laravelのnginxの環境でassetsがNot found(404)
Nov 5, 2014NginxでLaravelを使っているのですが、css、js、画像関係のassetがNot foundになったので、その際にnginxに設定方法下記のようにして対応しました。
| 
					 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33  | 
						server {   listen   80;   server_name domain.com;   access_log /var/log/nginx/domain.access.log;   error_log /var/log/nginx/domain.error.log;   set $root_path '/var/www/html/laravel/public';   root  $root_path;   index  index.php index.html;   try_files $uri $uri/ @rewrite;   location @rewrite {     rewrite ^/(.*)$ /index.php?_url=/$1;   }   location ~ .php$ {     root   /var/www/html/laravel/public;     fastcgi_pass   127.0.0.1:9000;     fastcgi_index  index.php;     fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;     include        fastcgi_params;   }   location ~ /.ht {     deny all;   }   location ~* .(jpg|jpeg|png|gif|ico|css|js)$ {     root   /var/www/html/laravel/public;     expires max;     add_header Cache-Control public;     access_log off;   } }  | 
					
Twitter: 
Warning:  Undefined array key "Twitter" in /home/sazaeau/mizoshiri.com/public_html/blog.mizoshiri.com/wp-content/plugins/sns-count-cache/sns-count-cache.php on line 2897
0 | Facebook: 0 | Google Plus: 
Warning:  Undefined array key "Google+" in /home/sazaeau/mizoshiri.com/public_html/blog.mizoshiri.com/wp-content/plugins/sns-count-cache/sns-count-cache.php on line 2897
0			| Hatena: 0 | Pocket: 0 | Total: 0 | Feedly: 0
