I have and old project that now requires new functionality, I\'m going to use laravel to provide it, everything in working ok in xampp with apache but my server con nginx sh
For some reason for me, the alias was causing the issue and didn't work. So maybe this will help others, so here is what I did to make this work. As you can see I took the "alias" out of it and added laravel/public to the equation.
location ^~ /laravel/public {
index home.php home.html home.htm index.html index.htm index.php;
try_files $uri $uri/ @laravel;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
charset utf-8;
location ~ \.php {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
include fastcgi_params;
}
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
location @laravel {
rewrite /laravel/public/(.*)$ /laravel/public/index.php?/$1 last;
}