V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
13162951900
V2EX  ›  问与答

nginx rewrite query_string 问题

  •  
  •   13162951900 · Jul 28, 2015 · 3779 views
    This topic created in 3932 days ago, the information mentioned may be changed or developed.

    场景:

    a.com 全站跳转 b.com
    
    服务器场景
    
    nginx → nginx + php
    
    配置文件:
    
    if ($host = 'www.a.com') {
        rewrite ^ $scheme://www.b.com$uri?$args permanent;
    }
    
    导致问题:
    
    www.a.com/x.cc?cao=nimei 
    
        red to :
    
    www.b.com/x.cc?cao=nimei?cao=nimei
    
    费解。参数这块 试了 document_uri request_uri。  请同学们赐教啦
    
    1 replies    2015-07-28 12:03:21 +08:00
    13162951900
        1
    13162951900  
    OP
       Jul 28, 2015
    结贴吧,我不知道hosts啥时候被改了。配置早就对了。后面用curl 测了一下location 立马看出问题了。 乌龙了sorry
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2703 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 13:40 · PVG 21:40 · LAX 06:40 · JFK 09:40
    ♥ Do have faith in what you're doing.