我想在 nginx 上配置 3 个站点(Drupal網站
www.domain.com == served in ==> /var/www/domain.com/
www.domain.com/folder01/ == served in ==> /var/www/folder01/
www.domain.com/folder02/ == served in ==> /var/www/folder02/
我知道该如何配置第一个,但我不知道该如何配置其他的。
答案1
我想你想了解location
指令(见这里)。
就你的情况而言:
server {
# server_name, listen, etc. - general settings
root /var/www/domain.com;
# some drupal-specific lines
location /folder01 {
root /var/www/folder01/;
# some drupal-specific lines
}
location /folder02 {
root /var/www/folder02/;
# some drupla-specific lines
}
}