启动随机主页
vim /etc/nginx/conf.d/default.conf
location / {
#root /usr/share/nginx/html;
#index index.html index.htm;
root /app;
random_index on;
}
systemctl restart nginx
创建主页目录
mkdir /app
touch /app/{blue.html,green.html,red.html,.yellow.html}
创建多个主页
<html>
<head>
<title>green color</title>
</head>
<body style="background-color:green">
<h1>green color!</h1>
</body>
</html>
刷新网页