确认系统网络node
确认yum可用linux
确认关闭iptables规则nginx
确认停用selinuxc++
安装gcc等:shell
安装基本工具:vim
cd /opt;mkdir app download logs work backup缓存
Nginx是一个开源且高性能、可靠的HTTP中间件、代理服务。
轻量级服务器
CPU亲和(affinity)网络
sendfileapp
注意:baseurl须要修改OS和OSRELEASE为你对应的服务器版本
目录
编译参数
安装目的目录或路径
执行对应模块时,nginx所保留的临时性文件
设定nginx进程启动的用户和用户组
设置额外的参数将被添加到CFLAGS变量
设置附加的参数,连接系统库
目录中随机选择一个主页
HTTP内容替换
Nginx的客户端状态
Nginx默认配置语法
events:
能够被记录到日志中的变量
HTTP请求变量
内置变量
nginx -tc /etc/nginx/nginx.conf:查询配置文件语法是否正确
nginx -s reload -c /etc/nginx/conf:重启
http_stub_status_module(展现Nginx相关信息)
random_index_module
http_sub_module
sub_filter string replacement
sub_filter_last_modified on|off
sub_filter_once on|off
注意:上述的Context:http,server,location
limit_conn_module(链接频率限制)
limit_conn_zone
limit_conn
limit_req_module(请求频率限制)
limit_req_zone
limit_req
http_access_module(基于IP的访问控制)
allow
deny
局限性:经过代理访问会失效
- 可使用http_x_forwarded_for
- 结合geo模块
- 经过http自定义变量传递
http_auth_basic_module(基于用户的信任登陆)
auth_basic
auth_basic_user_file
注意:file的格式是指定的,生成密码可使用httpd-tools
命令:htpasswd -c filePath username