VPS爱客--vps优惠_服务器优惠_vps评测

求指导,nginx反向***关于链接网址的替换为啥不成功??

root@dvps-72059:~/nginx-1.4.6# nginx -V
nginx version: nginx/1.4.6
built by gcc 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
TLS SNI support enabled
configure arguments: –with-cc-opt=’-g -O2 -fstack-protector –param=p-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2′ –with-ld-opt=’-Wl,-Bsymbolic-functions -Wl,-z,relro’ –prefix=/usr/share/nginx –conf-path=/etc/nginx/nginx.conf –http-log-path=/var/log/nginx/acce.log –error-log-path=/var/log/nginx/error.log –lock-path=/var/lock/nginx.lock –pid-path=/run/nginx.pid –http-client-body-temp-path=/var/lib/nginx/body –http-fastcgi-temp-path=/var/lib/nginx/fastcgi –http-***-temp-path=/var/lib/nginx/*** –http-scgi-temp-path=/var/lib/nginx/scgi –http-ugi-temp-path=/var/lib/nginx/ugi –with-debug –with-pcre-jit –with-ipv6 –with-http_l_module –with-http_stub_status_module –with-http_realip_module –with-http_addition_module –with-http_dav_module –with-http_geoip_module –with-http_gzip_static_module –with-http_image_filter_module –with-http_spdy_module –with-http_sub_module –with-http_xslt_module –with-mail –with-mail_l_module –add-module=./ngx_http_substitutions_filter_module-master

站点配置文件

  1. server {
  2.         listen 80;
  3.         server_name hkk.hxs.biz;
  4.         location / {
  5.                    subs_filter hukeke.wordpre.com hkk.hxs.biz;
  6.                    subs_filter_types text/html text/c text/xml;
  7.                    subs_filter https://$host http://$host;
  8.                    ***_pa https://hukeke.wordpre.com;
  9.                    ***_redirect off;
  10.                    ***_set_header X-Real-IP $remote_addr;
  11.                    ***_set_header X-Forwarded-For $***_add_x_forwarded_for;
  12.                    ***_set_header   Referer https://hukeke.wordpre.com;
  13.                    ***_connect_timeout 600;
  14.                    ***_send_timeout 600;
  15.                    ***_read_timeout 600;
  16.         }
  17. }

复制代码

为啥打开
http://hkk.hxs.biz 里面的链接还是hukeke.wordpre.com的
重庆网友:subs_filter 写在location外面试试
上海网友:已经搞定了
山东网友:已经搞定,貌似是这个原因
福建网友:server { listen 80; server_name www.BBBB. BBBB.; index index.php index.html index.htm; location / { default_type text/html; ***_cache am***; subs_filter_types text/c text/xml; subs_filter www.AAAA. www.BBBB.; #替换指定域名,此处把www.AAAA.替换成www.BBBB.# ***_set_header X-Real-IP$remote_addr; ***_set_header X-Forwarded-For $***_add_x_forwarded_for; ***_set_header Referer http://www.AAAA.; ***_set_header Host www.AAAA.; ***_pa http://www.AAAA.; ***_set_header Accept-Encoding ""; }}
北京网友:受教了

未经允许不得转载:VPS爱客 » 求指导,nginx反向***关于链接网址的替换为啥不成功??
分享到: 更多 (0)