mercredi 4 avril 2018

Tuning Laravel+Nginx in Debian. Routing

Does not work even

Route::get ('foo', function () {
     return 'Hello World';
});

in the web.php file - returns 404 My url http://localhost/project/public/foo Laravel 5.4

Here is my /etc/nginx/sites-available/default file:

# Default server configuration
#
server {
    listen 80 default_server;
    listen [::]:80 default_server;

    root /srv/www;

    # Add index.php to the list if you are using PHP
    index index.php index.html index.htm index.nginx-debian.html;

    server_name _;

    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include /etc/nginx/fastcgi.conf;
    #
    #   # With php-fpm (or other unix sockets):
        fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
    #   # With php-cgi (or other tcp sockets):
    #   fastcgi_pass 127.0.0.1;
        fastcgi_index index.php;
    }
}

Any help for me.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire