我有很多项目,比如/ var / www / html / test,/ var / www / html / test1等。 只想将我的域名附加到其中一个文件夹中。 操作系统是Debian。这是我的网站 - 可用配置
server {
server_name example.me;
root /var/www/html/example.me;
index index.html index.php;
# set expiration of assets to MAX for caching
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
expires max;
log_not_found off;
}
location / {
# Check if a file or directory index file exists, else route it to index.php.
try_files $uri $uri/ /index.php;
}
location ~* \.php$ {
fastcgi_pass 127.0.0.1:9000;
include fastcgi.conf;
}
}
我希望能帮助我解决这个问题。
答案 0 :(得分:1)
以下内容将使test
文件夹位于example.me
。
root /var/www/html/example.me;
更改为root /var/www/html/test;
sites-enabled
使用test1
在不同的网站配置文件中使用正确的server_name
和root
重复相同的过程。