I have installed nginx to my VPN. And I'm a very beginner with that so it might be a stupid mistake but I was unable to figure our or google it.
What I'm trying to do and keep failing in it is set the root folder for certain addresses. For example: mydomain.com/websiteone/ will have root folder in /var/www/websiteone/public/ and mydomain.com/websitetwo/ in /var/www/websitetwo/public/
Im using Laravel that why I need to do that.
Here is the confing and what I was attempting in different variations.
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www;
index index.html index.php index.htm;
location /websiteone/ {
root /var/www/websiteone/public/;
try_files $uri $uri/ 404;
}
location /websitetwo/ {
root /var/www/websitetwo/public/;
try_files $uri $uri/ 404;
}
}