首頁  >  問答  >  主體

Nginx 的 rewrite 功能會被丟棄?傳入的參數麼?

server {
  if ($host ~* ^example.com) {
    rewrite ^(.*) http://www.example.com permanent;
  }
}

當我發送 http://example.com/aa.jsp?time=1 這樣的請求的時候。轉發的請求變成了 http://www.example.com/aa.jsp 問號之後的參數都被丟棄了? ? ?

請問如何設定能部丟棄問號之後的參數?謝謝謝謝

仅有的幸福仅有的幸福2713 天前545

全部回覆(2)我來回復

  • 大家讲道理

    大家讲道理2017-05-16 17:26:51

    後來發現其實是自己在測試的時候犯錯了。 。 。完善測試條件之後就一切正常了。謝謝你的回覆

    回覆
    0
  • 習慣沉默

    習慣沉默2017-05-16 17:26:51


    if ($host = 'example.com' ) {
    重寫 ^/(.*)$ http://www.example.com/$1 permanent;
    }

    回覆
    0
  • 取消回覆