我想安装我的vps以同时开发多个网站。 我的根目录结构:
/var/www/html/web1;
/var/www/html/web2;
/var/www/html/wordpress1;
/var/www/html/wordpress1;
/var/www/html/drupal1;
/var/www/html/drupal2;
我想链接到网站http://123.123.123.123/drupal1,并且123.123.123.123是VPS的IP。
现在,每当我添加网站时,都必须编辑配置文件。是否可以为每个页面安装它?
这是我的Nginx配置:
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html index.php;
server_name _;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location @sub_rewrite {
rewrite ^/drupal1/(.*)$ /drupal1/index.php?$1;
}
location /drupal1/ {
try_files $uri @sub_rewrite;
}
}
谢谢大家!