nginx(多方式访问, 日志配置, 模块)
概要
- 访问web服务器的方式
- Nginx的配置文件中的日志配置
- Nginx 模块
- 访问控制模块
- ngx_http_access_module
- 允许或拒绝某些ip访问
- ngx_http_auth_basic_module
- 需登陆才能访问
- ngx_http_autoindex_module
- 开启目录索引效果
- 状态监控模块
- ngx_http_stub_status_module
- 连接数/请求数控制模块
- $remote_addr(重要)
- 客户端ip(上一次访问的)
- $remote_user
- 客户端用户名
- $time_local
- 时间
- $request
- 具体请求信息 如GET(访问类型) 及路径 及长/段连接
- status
- 状态 如304 404
- $body_bytes_sent
- 访问文件大小
- $http_referer
- 访问的域名
- $http_user_agent
- 客户端操作系统(iphone Android )
- $http_x_forwarded_for (重要)
- 真实的客户端IP(在反向代理中配置生效)???
- 网站排错
- --without-http_access_module
- 403 报错
- 发现访问的机器ip是192.168.15.1 ,与设定只允许192.168.15.7访问
- 结果成功
- curl -I http://www.baidu.com
- 理解:
- allow VPN所在主机的ip;
- deny all;
- ./configure --help | grep ngx_http_auth_basic_module
- --without-http_autoindex_module
- vim /etc/nginx/conf.d/game_autoindex.conf
- cat /var/log/nginx/error.log
- POST 创建数据
- DELETE 删除数据
- PUT 修改数据
- GET 查看数据