Laravelのnginxの環境でassetsがNot found(404)
Nov 5, 2014AD:
		
		
	
	Nginxで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;   } }  | 
					
		AD:
			
			
		
		
	
No Comments, Comment or Ping
Reply to “Laravelのnginxの環境でassetsがNot found(404)”
Warning: Undefined variable $user_ID in /home/sazaeau/mizoshiri.com/public_html/blog.mizoshiri.com/wp-content/themes/grid_focus_public_mizo/comments.php on line 66
You must be logged in to post a comment.