【Nginx】基于HTTP的反向代理
2015-09-01 18:50
281 查看
一、安装步骤:
二、nginx.conf文件中配置负载均衡
cd /app wget http://nginx.org/download/nginx-1.6.3.tar.gz unzip nginx-1.6.3.tar.gz cd /app/nginx-1.6.3 ./configure make make install
二、nginx.conf文件中配置负载均衡
worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; upstream baidu { server 10.100.138.1:8080; server 10.100.138.2:8080; } server { listen 80; server_name www.baidu.com; access_log /app/nginx/logs/baidu.log main; location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://baidu; } } }
相关文章推荐
- SCMHttpclient
- 【Nginx】基于TCP的反向代理
- [网络监控]iftop 安装以及相关参数及说明
- 使用PHP SoapClient 处理自建证书的https服务
- 71.自动检测iOS网络并可跳转至设置界面设置网络
- 新人开博,自娱自乐一下。
- Node.js开发入门—HTTP文件服务器
- 51.TCP Socket服务器编程
- HTTP状态码表
- 45.【IOS网络编程】socket编程 - Asyncsocket
- 46.【IOS网络通信】socket第三方库 AsyncSocket(GCDAsyncSocket)
- HTTPS推荐文章
- SpringMVC XSS之HttpServletRequestWrapper使用风险与应对方案
- TCP FIN_WAIT_2状态问题分析
- 网络视图WebView的使用实例
- Linux 网络编程学习---socket
- 看懂信息检索和网络数据挖掘领域论文的必备知识总结
- (坑!!待补)Linux____基础API底层执行过程(网络通信)
- 使用nginx-http-concat优化网站响应
- HDU3338 Kakuro Extension 网络流 isap