php - Laravel - 404 Not Found -
i started using laravel last few days , have problem on url routing, http://localhost:8017/laravel
looks http://localhost:8017/laravel/foo
returns
404 not found
my os ubuntu 16.04, laravel 5.4
routes/web.php
route::get('/', function () { return view('welcome'); }); // oedin route::get('foo', function () { return 'hello world'; });
nginx configuration
server { listen 8017 default_server; listen [::]:8017 default_server; # ssl configuration # # listen 443 ssl default_server; # listen [::]:443 ssl default_server; # # note: should disable gzip ssl traffic. # see: https://bugs.debian.org/773332 # # read on ssl_ciphers ensure secure configuration. # see: https://bugs.debian.org/765782 # # self signed certs generated ssl-cert package # don't use them in production server! # # include snippets/snakeoil.conf; #root /var/www/html; root /home/oedin/webdev; # add index.php list if using php index index.php index.html index.htm; server_name localhost; location / { try_files $uri $uri/ /index.php?$query_string; } # pass php scripts fastcgi server listening on 127.0.0.1:9000 # location ~ \.php$ { include snippets/fastcgi-php.conf; #try_files $uri /index.php =404; #fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/run/php/php7.0-fpm.sock; #fastcgi_index index.php; #fastcgi_param script_filename $document_root$fastcgi_script_name; #include fastcgi_params; } # deny access .htaccess files, if apache's document root # concurs nginx's 1 # #location ~ /\.ht { # deny all; #} }
if want serve app nginx, it's recommended make new nginx vhost configuration contains project root folder.
however life easier php artisan serve
, , no need nginx server @ point .
Comments
Post a Comment