タグ

2020年2月10日のブックマーク (4件)

  • NGINX $request_uri vs $uri

    inoueyuworks
    inoueyuworks 2020/02/10
    request_uri と uri の違い: uri は、正規化された結果のパス部分を表す。 request_uri はオリジナルを表す。 uri を proxy_redirect に利用すると、 injection されうる?
  • Nested Nginx location (prefix blocks in regex blocks) not working

    Stack Exchange Network Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. Visit Stack Exchange

    Nested Nginx location (prefix blocks in regex blocks) not working
    inoueyuworks
    inoueyuworks 2020/02/10
    nested location の際には、 親 regex -> 子 prefix のネスト関係は実現できない。 親 prefix -> 子 regex は可能。
  • How to define a global variable in nginx conf file

    How to define a global variable in nginx conf file, define a global var in http block,and all servers and locations below can use it. http{ some confs ... //define a global var mabe like set APP_ROOT /home/admin // and it can be use in all servers and locations below, like server { root $APP_ROOT/test1 } server { root $APP_ROOT/test2 } }

    How to define a global variable in nginx conf file
    inoueyuworks
    inoueyuworks 2020/02/10
    グローバル変数みたいなことやりたくなったら、 http ディレクティブ直下に map を定義すると、いける。
  • nginx連載5回目: nginxの設定、その3 - locationディレクティブ

    locationディレクティブはパスの条件が評価されて選ばれたものが適応されます。この条件はパスの文字列の前方一致あるいは正規表現による評価です。この評価の順番は以下のようになります。 前方一致("=", "^~", プレフィックスなし)の条件の評価を実施 最も一致する条件を選ぶ。 選ばれた条件が、完全一致で、プレフィックスが"="であれば、そこで評価を終了し、そのlocationディレクティブを適応する。 選ばれた条件のプレフィックスが"^~"であれば、そこで評価を終了して、そのlocationディレクティブを適応する。 正規表現("~", "~*")の条件の評価を実施 正規表現の条件を設定ファイルに定義した順番に評価する。一致したら、そこで評価を終了して、そのlocationディレクティブを適応する。 前方一致の評価で選ばれた条件のlocationディレクティブを適応する。 ここで注意

    nginx連載5回目: nginxの設定、その3 - locationディレクティブ
    inoueyuworks
    inoueyuworks 2020/02/10
    location は、 1. = による完全一致 2. ^~ による longest prefix 3. 正規表現を定義順の first match 4. 単純前方一致の longest