Answer the question
In order to leave comments, you need to log in
How to override root in NGINX?
There is a site with the structure:
admin/
- controllers/
- index.php (entry point to the admin panel, handles routing)
index.html
current config:
server {
listen 80;
server_name project.local
location / {
index index.php;
root /home/user/Sites/project/;
try_files $uri $uri/ /admin/index.php;
location ~* \.php {
include fastcgi_params;
fastcgi_pass unix:/run/php/php7.1-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ^~ /admin/* {
index index.php;
root /home/user/Sites/project/admin/;
try_files $uri $uri/ /admin/index.php;
}
}
}
root /home/user/Sites/project/sites/site1
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question