利用Nginx 做反向代理替换掉页面部分内容
2015-09-12 00:00
681 查看
摘要: nginx 反向代理 替换模块安装配置
修改配置文件后,加载新的配置使生效
cd /usr/local/src wget -c http://nginx.org/download/nginx-1.9.4.tar.gz wget -c https://github.com/yaoweibin/ngx_http_substitutions_filter_module/archive/master.zip unzip master.zip tar -xzf nginx-1.9.4.tar.gz yum -y install pcre-devel openssl openssl-devel cd nginx-1.9.4 ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre --with-http_realip_module --add-module=/usr/local/src/ngx_http_substitutions_filter_module-master make && make install
server { listen 80; server_name www.yourdomain.com; location / { proxy_pass http://www.target_host.cn; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; subs_filter search_text replace_text; index index.html index.htm; } }
修改配置文件后,加载新的配置使生效
/usr/local/nginx/sbin/nginx -s reload
相关文章推荐
- 【ghost】centos使用nginx实现ghost博客系统的反向代理
- nginx反向代理,动静态分离,缓存
- Squid限制带宽
- Squid限制带宽
- 阿里云-ECS-nginx反向代理-安装
- 使用Nginx反向代理解决AJAX跨越问题
- centos6.5搭建nginx反向代理Apache服务并实现动静分离
- Nginx 反向代理、负载均衡、页面缓存、URL重写及读写分离详解
- Nginx和Squid配合搭建的Web服务器前端系统
- (总结)Linux服务器上最简单的Nginx反向代理配置
- squid 代理缓存服务器
- 正向代理和反向代理
- Nginx 反向代理 动静分离
- Nginx的反向代理 和 负载均衡
- Nginx 反向代理 Tomcat 传递自定义 Head 问题总结
- Squid
- 什么是反向代理,如何区别反向与正向代理
- 映射公网(花生壳、PubYun、No-IP、DynDNS、Ngrok、Tunnel、localtunnel、pagekite)
- squid缓存服务的搭建和配置管理
- 搭建nginx反向代理用做内网域名转发