2017-12-26 14 views
1

/support URLを書き直そうとしていますので、「ページ」を添付のクエリー文字列として取得できます。nGinx書き換え問題除外

私が今実行している問題は、assets/supportサブフォルダに含まれているため、あまりにも書き直されています。

アセットを除外するにはどうすれば変更できますか? (ここで、資産= /サポート/資産/スタイル/サポート/資産/スクリプト、等...)

ここでは、あなたが実行する前にtry_filesと資産のために確認することができます私の現在のlocationブロック

location /support/ { 
    index index.php; 
    rewrite ^/support/(.*) /support/index.php?_p=$1 last; 
    try_files $uri $uri/ /support/index.php?$args; 
} 
+0

「location/support/assets/{エイリアス<アセットフォルダのパス」; } ' –

+0

'/support/assets/'は私の' 'です。 – Kevin

+0

あなたはそのパスも内部で見ることができます。 URLの場所とフォルダのパスは2つの異なるものです。たとえ同じものであっても、それを提供する必要があります –

答えて

1

です「location」という名前を使用してrewrite例えば

location /support/ { 
    index index.php; 
    try_files $uri $uri/ @rewrite; 
} 
location @rewrite { 
    rewrite ^/support/(.*) /support/index.php?_p=$1 last; 
} 

は、より多くのためにthis documentを参照してください。