Fresh laravel installation not work in nginx server (Ubuntu)

Doo Doo

I just set up nginx web server inside my ubunutu 14.04 lts with fresh laravel project. My project name laravel and when I go to http://localhost/laravel/public/ I can see the laravel welcome page display, but when I create an url to test it didn't work.

    Route::get('test', function(){
      return 'It is work!!!';
});

I hope when I go to http://localhost/laravel/public/test | http://localhost/laravel/public/index.php/test it should display It is work!!! instead of this I get 404 Not Found nginx/1.4.6 (Ubuntu). I don't know what is wrong? I have php7 ubuntu 1.4.6 installed in my machine.

Here is nginx configuration->

server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;

root /usr/share/nginx/html;
index index.php index.html index.htm;

server_name localhost;

location / {
    #try_files $uri $uri/ =404;
    try_files $uri/ $uri /index.php?$query_string;
}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
    try_files $uri /index.php =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_index index.php;
    include fastcgi_params;
}

}

Please help me. I really thankful fro your help.

Lance Pioch

It looks like Bogdan already answered this in the comments. But for anybody else, make sure to point your document root to the /public directory of your Laravel project.

root /usr/you/laravelinstall/public;

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Ubuntu 15.10 Fresh Installation Errors

From Dev

Default user in Ubuntu fresh installation

From Dev

Grub Installation Failed Ubuntu 16.04 fresh Installation

From Dev

Cant start laravel 5.6 on Ubuntu server with NGINX

From Dev

Fresh Ubuntu UEFI installation won't boot

From Dev

Fresh Ubuntu 16.04 installation does not boot

From Dev

Import program files into fresh Ubuntu installation

From Dev

What are all these SSL certificates on a fresh installation of Ubuntu?

From Dev

Fresh Ubuntu 18.04 installation has no dpkg and no internet

From Dev

Ubuntu 18.04 is not showing desktop - fresh installation

From Dev

Ubuntu 20.04 fresh installation Microphone not working

From Dev

hplip not working on fresh Ubuntu 20.04 installation

From Dev

Fresh Ubuntu UEFI installation won't boot

From Dev

composer update error on fresh installation of laravel 5

From Dev

Wifi doesnt work on fresh ubuntu 16.04

From Dev

Ubuntu Server Blinking Cursor after Fresh Install

From Dev

Fresh Install of Ubuntu Server 19.04 Has No Internet?

From Dev

New Windows 8 branded computer, fresh Ubuntu installation

From Dev

New Windows 8 branded computer, fresh Ubuntu installation

From Dev

How to do a fresh re-installation of Ubuntu safely on dual boot?

From Dev

Fresh Ubuntu 18.04 LTS Installation will only boot into grub mode

From Dev

Will a fresh installation of Ubuntu recognize two drives that have been in a RAID?

From Dev

Ethernet Interface does not show after fresh installation of Ubuntu 20.04

From Java

Laravel 8 fresh installation livewire directory does not exist

From Dev

Laravel Spark registration view not loading after fresh installation

From Dev

Ubuntu 14.04 Server installation

From Dev

Ubuntu Server for MongoDB installation

From Dev

Ubuntu server installation on Ubuntu deskop

From Dev

Need help partitioning a hard disk on a fresh install of ubuntu server

Related Related

  1. 1

    Ubuntu 15.10 Fresh Installation Errors

  2. 2

    Default user in Ubuntu fresh installation

  3. 3

    Grub Installation Failed Ubuntu 16.04 fresh Installation

  4. 4

    Cant start laravel 5.6 on Ubuntu server with NGINX

  5. 5

    Fresh Ubuntu UEFI installation won't boot

  6. 6

    Fresh Ubuntu 16.04 installation does not boot

  7. 7

    Import program files into fresh Ubuntu installation

  8. 8

    What are all these SSL certificates on a fresh installation of Ubuntu?

  9. 9

    Fresh Ubuntu 18.04 installation has no dpkg and no internet

  10. 10

    Ubuntu 18.04 is not showing desktop - fresh installation

  11. 11

    Ubuntu 20.04 fresh installation Microphone not working

  12. 12

    hplip not working on fresh Ubuntu 20.04 installation

  13. 13

    Fresh Ubuntu UEFI installation won't boot

  14. 14

    composer update error on fresh installation of laravel 5

  15. 15

    Wifi doesnt work on fresh ubuntu 16.04

  16. 16

    Ubuntu Server Blinking Cursor after Fresh Install

  17. 17

    Fresh Install of Ubuntu Server 19.04 Has No Internet?

  18. 18

    New Windows 8 branded computer, fresh Ubuntu installation

  19. 19

    New Windows 8 branded computer, fresh Ubuntu installation

  20. 20

    How to do a fresh re-installation of Ubuntu safely on dual boot?

  21. 21

    Fresh Ubuntu 18.04 LTS Installation will only boot into grub mode

  22. 22

    Will a fresh installation of Ubuntu recognize two drives that have been in a RAID?

  23. 23

    Ethernet Interface does not show after fresh installation of Ubuntu 20.04

  24. 24

    Laravel 8 fresh installation livewire directory does not exist

  25. 25

    Laravel Spark registration view not loading after fresh installation

  26. 26

    Ubuntu 14.04 Server installation

  27. 27

    Ubuntu Server for MongoDB installation

  28. 28

    Ubuntu server installation on Ubuntu deskop

  29. 29

    Need help partitioning a hard disk on a fresh install of ubuntu server

HotTag

Archive