智能提醒助理系列-Nginx搭建
nginx 是产品搭建中不可缺失的一环
1、linux 下安装nginx
sudo yum install epel-release
sudo yum install nginx
2、安装后设置开机启动
sudo systemctl start nginx
sudo systemctl enable nginx
3、配置文件关闭版本号
upstream znzlapps {
server localhost:9000;
}
server {
listen 80;
server_name c.znzl.cc;
server_tokens off; #不展示nginx 版本号
charset utf-8;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
if ( !-f $request_filename) {#-f
proxy_pass http://znzlapps;
}
}
}