ngnix反向代理配置
2015-06-25 16:01
531 查看
## Basic reverse proxy server ##
upstream apachephp {
server ip:8080; #Apache
}
## Start www.example.com ##
server {
listen 80;
server_name www.example.com;
access_log logs/example.access.log main;
error_log logs/example.error.log;
root html;
index index.html index.htm index.php;
## send request back to apache ##
location / {
proxy_pass http://apachephp;
#Proxy Settings
proxy_redirect off;
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_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_max_temp_file_size 0;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
}
upstream apachephp {
server ip:8080; #Apache
}
## Start www.example.com ##
server {
listen 80;
server_name www.example.com;
access_log logs/example.access.log main;
error_log logs/example.error.log;
root html;
index index.html index.htm index.php;
## send request back to apache ##
location / {
proxy_pass http://apachephp;
#Proxy Settings
proxy_redirect off;
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_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_max_temp_file_size 0;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
}
相关文章推荐
- nginx反向代理和 ip重定向到域名配置
- 解决nginx反向代理缓存不起作用的问题
- CentOS 6.4下Squid代理服务器的安装与配置【转】
- 在varnish、squid、apache、nginx中选出一个更好的缓存服务器
- CDN实现方案如何选择: squid Varnish Nginx
- nginx ats squid varnish使用场景对比介绍
- Nginx反向代理与负载均衡
- tengine反向代理tomcat多实例实现负载均衡
- Nginx反向代理 实现4台服务器负载均衡
- squid删除指定url的缓存配置
- Tomcat反向代理+负载均衡的四种方法配置
- Squid的简单使用
- 用HAProxy和KeepAlived构建高可用的反向代理
- Apache使用mod_proxy和mod_jk反向代理Tomcat
- centos下squid的安装
- nginx的反向代理
- apache 反向代理:apache和iis共用80端口
- 【大型网站技术实践】初级篇:借助Nginx搭建反向代理服务器
- Linux下Squid正向/反向代理配置
- ubuntu10.04 squid配置