登录成功然后就跳转到源站了-_-#

[audio:http://media.jybb.me/music/%E4%B8%81%E5%BD%93%20-%20%E6%B4%8B%E8%91%B1.mp3|autostart=yes]
反代了一个论坛,输入账号密码登录后,会跳转回原来的站。用了subs_filter也一样。

一直在苦恼这个问题,经某人点拨,Discuz跳转的文件是xml后缀的(详情哪个文件我也不知道....)

打开ngx_http_substitutions_filter_module的github看到:

subs_filter_types
syntax: *subs_filter_types mime-type [mime-types] *

default: *subs_filter_types text/html*

context: *http, server, location*

*subs_filter_types* is used to specify which content types should be
checked for *subs_filter*. The default is only *text/html*.

This module just works with plain text. If the response is compressed,
it can't uncompress the response and will ignore this response. This
module can be compatible with gzip filter module. But it will not work
with proxy compressed response. You can disable the compressed response
like this:

proxy_set_header Accept-Encoding "";

好吧,原来是没指定替换类型,默认只替换html

在nginx站点配置中加入下面:

重启nginx就解决了

 

   

已有 23 條評論

  1. 花七七 11 年前 (2013-03-09)
    @

    QJJ= =

  2. 大笨马优惠码 11 年前 (2013-03-08)
    @

    谁唱的这歌 累死了吧。真难听

  3. 天佑我们715 11 年前 (2013-03-07)
    @

    老大 /usr/local/nginx/conf/vhost/你的域名.conf 是修改这里的配置文件吗?subs_filter_types text/css text/xml application/xhtml+xml application/xml;这段应该具体加在哪里啊 我现在点登陆就自动跳出来没有登陆 域名是没有变的

    • 飛天鼠 11 年前 (2013-03-08)
      @

      加在location /里面,subs_filter前面

      • 天佑我们715 11 年前 (2013-03-08)
        @

        其实我是直接在AMH反代里面试的,不过还是不行,方便吗?怎么联系你

        • 飛天鼠 11 年前 (2013-03-09)
          @

          AMH没有过- –

  4. 前川神奈 11 年前 (2013-03-05)
    @

    反向代理有什么好处啊

    • 飛天鼠 11 年前 (2013-03-09)
      @

      隐藏后端ip,采集,加速之类的。。。

  5. 我要发芽 11 年前 (2013-02-26)
    @

    反向代理是不是打都用nginx?

    • 飛天鼠 11 年前 (2013-03-01)
      @

      不一定啊。。。squid varnish都可以用

  6. 给力的 11 年前 (2013-02-26)
    @

    刚找到的种子,里面有3000多个美妞的自拍视频,搜索了两年啊,我上传网盘了 http://www.ctdisk.com/file/17373485 你别乱传

  7. 空空裤兜 11 年前 (2013-02-24)
    @

    hello MJJ

  8. 秦冰 11 年前 (2013-02-23)
    @

    wordpress呢mjj

    • 飛天鼠 11 年前 (2013-02-24)
      @

      wordpress 用php判断的吧?貌似无解啊-_-#

  9. 花七七 11 年前 (2013-02-23)
    @

    hello,MJJ

  10. Suming 11 年前 (2013-02-22)
    @

    绝对路径换成相对路径?

    • 飛天鼠 11 年前 (2013-02-22)
      @

      替换掉域名。。。

      • Suming 11 年前 (2013-02-22)
        @

        你个MJJ还不睡啊?

        • 慕叶思晨 11 年前 (2013-02-22)
          @

          Hello,mJJ!

          • Suming 11 年前 (2013-02-22)
            @

            你好,MJJ! →_→