Laravel 5.4 Nginx 1.10 PHP 7 route except "/" are returning 404

Allen.Han

This is my config

server {
    listen 80;
    listen [::]:80;

    server_name mysite.com;

    root /var/www/site/public;
    index index.php index.html;

    location / {
            try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ \.php$ {
            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;
    }
}

The root of my site is accessible, all other routes are returning a 404 error.

Thanks in advance.

Cheers.

Allen.Han

I am not sure what the difference is, but I deleted the config file and made a copy of the default config, made changes to the lines I needed to. (i.e. server_name, root)

And it started working.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related