随笔分类 - 04 nginx
摘要:##效果: ##nginx添加ssl模块 ./configure --with-http_ssl_module ##生成证书 openssl genrsa -out ca.key 2048 openssl req -new -x509 -days 1096 -key ca.key -out ca.c
阅读全文
摘要:负载均衡 upstream 访问:http://127.0.0.1:80刷新,会在三个server中切换。 默认的负载均衡策略是轮询,还有ip_hash ,最少连接。 权重: 停止服务: 当配置down时,同组的weight就不能配置。
阅读全文
摘要:反向代理: proxy_pass http://127.0.0.1:8000 是python 提供的http服务。 访问:http://127.0.0.1/n 结果重定向到:http://127.0.0.1/test/ 404 Not Found 访问:http://127.0.0.1/n/ 结果正
阅读全文
摘要:配置文件: server_name 表示没有设置Host字段的请求都返回405,也可以写一个非标码(444)表示关闭连接。 添加虚拟主机: 当然,需要修改hosts文件: 添加: html/下新建ngx1.html,ngx2.html 浏览器测试: http://192.168.2.192/ 405
阅读全文
摘要:以上内容来自:http://www.nginx.cn/76.html
阅读全文

浙公网安备 33010602011771号