随笔分类 - Nginx
摘要:nginx的启停操作 nginx 启动 nginx -s stop 停止 nginx -s reload 重新加载 nginx -t 修改配置文件之后进行语法检验
阅读全文
摘要:nginx负载均衡 nginx代理机分发到多台同一项目的服务机 负载均衡器代理机配置:nginx.conf的http{}: #代理池,运行在不同服务机的程序 upstream loadtest{ server 192.168.160.132:8001; server 192.168.160.133:
阅读全文
摘要:nginx代理功能 至少需要两台主机: 代理机配置 如下: yum安装的/etc/nginx/nginx.conf location / { #服务机的ip端口 proxy_pass http://192.168.160.132:80; } 注意停用防火墙: systemctl stop firew
阅读全文
摘要:状态模块功能 nginx.conf中的http{}中的server{}中: location /status { #开启nginx状态功能 stub_status on; } 直接在网页中请求status页面即可显示 linux的压力测试功能 1.安装ab命令 yum -y install http
阅读全文
摘要:虚拟主机功能: 一个nginx下运行多个网址(站点域名) 方式一:nginx.conf中的http{}中的每一个server{}就是一个站点(相同端口): #虚拟主机1 server { listen 80; server_name www.nginx1.com; location / { #den
阅读全文
摘要:禁止访问功能配置 nginx.conf中的http{}中的server{}的location ..{}中: location / { #拒绝访问,192.168.16.0网段的同学都无法访问 /24是子网掩码的意思 deny 192.168.16.0/24; root html; index ind
阅读全文
摘要:站点服务请求功能配置:html/ nginx.conf中的http{}中的server{}: server { listen 85; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; #acc
阅读全文
摘要:错误日志功能:logs/error.log nginx.conf中: #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #error_log "pipe:rollb
阅读全文
摘要:nginx配置文件/conf/nginx.conf 错误日志功能:los/error.log 访问日志功能:logs/access.log 站点服务请求功能配置:html/ 禁止访问功能配置 404页面 虚拟主机功能 状态模块功能 linux的压力测试功能 nginx代理功能 nginx负载均衡 n
阅读全文
摘要:nginx安装目录 conf 存放nginx的配置文件 在修改配置文件nginx.conf之前,一般先备份cp nginx.conf nginx.conf.bak html 存放前端文件的 默认带有首页index.html和f服务器错误提示50x.html页面 logs 存放nginx的日志文件 e
阅读全文
摘要:nginx简介 Nginx (engine x) 是一个高性能的HTTP和反向代理web服务器,同时也提供了IMAP/POP3/SMTP服务。 nginx安装 注意使用yum安装过nginx要卸载yum remove nginx 1.解决环境依赖 yum install gcc patch libf
阅读全文