Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

By mikevrind
Hi,
I just installed my first droplet (LEMP) thanks to some information on DO tutorials. But I’m having a problem and I dont know what is the cause (or fix :) ) for the issue.
I created a new file in ‘sites-available’ with the following server block;
server {
server_name ~^(.+)\.dev\.mydomain\.nl$;
set $file_path $1;
root /home/dev-mydomain-nl/$file_path/public/;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
# pass the PHP scripts to FastCGI server listening on /var/run/php5-fpm.sock
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
As you can see, I created a wildcard subdomain which also has a variable root directory. I also installed the Laravel framework. When I visit a domain, I see Laravels default page. But as soon as I browser to an page (for example …nl/test/) I get the 403 - Forbidden page.
The error in the log file also states:
directory index of "/home/dev-mydomain-nl/mike/public/test/" is forbidden
What should happen, is that all trafic is routed to the index file (unless the file itself exists). But what should I change in the Nginx config?