0
点赞
收藏
分享

微信扫一扫

Nginx基础篇(14)随机主页模块

sunflower821 2022-06-05 阅读 116

启动随机主页

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>

刷新网页

Nginx基础篇(14)随机主页模块_nginx

Nginx基础篇(14)随机主页模块_linux_02

Nginx基础篇(14)随机主页模块_linux_03

举报

相关推荐

0 条评论