Sorry for dumb question but is it possible to get a part of URL right after domain name via `server_name` variable?
server {
listen 80;
index index.php index.html;
server_name ~^localhost/(?<project>)/.+$;
root /var/www/$project/public;
...
}
The idea is to change root path in relation of it's folder structure:
1) "/var/www/project-one/public/index.php"
2) "/var/www/project-two/public/index.php"
So I would be able to reach entry point of each project by requests:
"http://localhost/project-one/" ->> "/var/www/project-one/public/"
"http://localhost/project-two/" ->> "/var/www/project-two/public/"
How to implement such behavior w/o using `alias`?
server {
listen 80;
index index.php index.html;
server_name ~^localhost/(?<project>)/.+$;
root /var/www/$project/public;
...
}
The idea is to change root path in relation of it's folder structure:
1) "/var/www/project-one/public/index.php"
2) "/var/www/project-two/public/index.php"
So I would be able to reach entry point of each project by requests:
"http://localhost/project-one/" ->> "/var/www/project-one/public/"
"http://localhost/project-two/" ->> "/var/www/project-two/public/"
How to implement such behavior w/o using `alias`?