1

I am trying to run laravel on aws server in a sub-directory, the website functions properly when pointed to root location, but when pointing it to a sub-directory in a URL the routes does not work, i can see the welcome page in laravel in the sub directory but i cannot access any routes. when i click on routes i get 404 screen of nginx.

Below is my nginx config for laravel

location /dashboard {
    alias /var/www/laravel/public;

    try_files $uri $uri/ @dashboard;


    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_param SCRIPT_FILENAME $request_filename;
        fastcgi_pass   unix:/run/php/php7.3-fpm.sock;          
    }
}

location @dashboard {
    rewrite ^/dashboard/(.*)$ /laravel/index.php/$1 last;
}
1
  • What about your Laravel configuration?
    – womble
    Oct 16, 2019 at 8:48

0

You must log in to answer this question.

Browse other questions tagged .