随笔分类 -  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 阅读全文
posted @ 2018-04-13 15:27 懒企鹅 阅读(466) 评论(0) 推荐(0)
摘要:负载均衡 upstream 访问:http://127.0.0.1:80刷新,会在三个server中切换。 默认的负载均衡策略是轮询,还有ip_hash ,最少连接。 权重: 停止服务: 当配置down时,同组的weight就不能配置。 阅读全文
posted @ 2017-12-01 16:44 懒企鹅 阅读(234) 评论(0) 推荐(0)
摘要:反向代理: 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/ 结果正 阅读全文
posted @ 2017-11-29 17:58 懒企鹅 阅读(273) 评论(0) 推荐(0)
摘要:配置文件: server_name 表示没有设置Host字段的请求都返回405,也可以写一个非标码(444)表示关闭连接。 添加虚拟主机: 当然,需要修改hosts文件: 添加: html/下新建ngx1.html,ngx2.html 浏览器测试: http://192.168.2.192/ 405 阅读全文
posted @ 2017-11-29 16:55 懒企鹅 阅读(314) 评论(0) 推荐(0)
摘要:以上内容来自:http://www.nginx.cn/76.html 阅读全文
posted @ 2017-11-20 17:15 懒企鹅 阅读(260) 评论(0) 推荐(0)