nginxのHTTP機能がngx_http_range_filter_moduleによって実装されます。
実際には、このモジュールは2つのモジュールngx_http_range_header_filter_moduleの1で構成され、
例えば、に応答して提供されるHTTPヘッダー情報:コンテンツレンジ、指定された応答間隔ブロックの開始終了位置を設定します。
場合の応答パケットを指定HTTPコンテンツの長さ、体の大きさに設けられ、206の代わりに200ヤード等の応答コードに応答して提供されます。
別のモジュールngx_http_range_body_filter_module、バッファーゾーンから指定されたコンテンツのためのブロック、及びクライアントへのブロック範囲の内容。
イベントをトリガするための最もイベントnginxの方法のepollのEPOLLET(エッジトリガ)は、イベントは、読み取り専用ポートEPOLLLT(レベルトリガ)である聞きます。
イベントが読める発生した場合、エッジ・トリガの場合は、時間でなければならず、それ以外の場合は、イベントを読み取るように見えることがもはやトリガ接続死亡が報告されていないされています。
CPUのスピンロック
nginxのイベントハンドラのエントリ関数は)(ngx_process_events_and_timersです
ngx_process_events()関数は、項目ハンドルは、それがすべてのイベントを通過し、すべてのイベントです。
買収は変数説明パラメータ:
- プロパティ
方法= ngx.var.request_method - http://wiki.nginx.org/HttpCoreModule#.24request_method
スキーマ= ngx.var.schema - http://wiki.nginx.org/HttpCoreModule#.24scheme
ホスト= ngx.var.host - http://wiki.nginx.org/HttpCoreModule#.24host
ホスト名= ngx.var.hostname - http://wiki.nginx.org/HttpCoreModule#.24hostname
詩= ngx.var.request_uri - http://wiki.nginx.org/HttpCoreModule#.24request_uri
パス= ngx.var.uri - http://wiki.nginx.org/HttpCoreModule#.24uri
ファイル名= ngx.var.request_filename - http://wiki.nginx.org/HttpCoreModule#.24request_filename
QUERY_STRING = ngx.var.query_string - http://wiki.nginx.org/HttpCoreModule#.24query_string
user_agentの= ngx.var.http_user_agent - http://wiki.nginx.org/HttpCoreModule#.24http_HEADER
REMOTE_ADDR = ngx.var.remote_addr - http://wiki.nginx.org/HttpCoreModule#.24remote_addr
REMOTE_PORT = ngx.var.remote_port - http://wiki.nginx.org/HttpCoreModule#.24remote_port
REMOTE_USER = ngx.var.remote_user - http://wiki.nginx.org/HttpCoreModule#.24remote_user
remote_passwd = ngx.var.remote_passwd - http://wiki.nginx.org/HttpCoreModule#.24remote_passwd
CONTENT_TYPE = ngx.var.content_type - http://wiki.nginx.org/HttpCoreModule#.24content_type
CONTENT_LENGTH = ngx.var.content_length - http://wiki.nginx.org/HttpCoreModule#.24content_length
ヘッダー= ngx.req.get_headers() - http://wiki.nginx.org/HttpLuaModule#ngx.req.get_headers
uri_args = ngx.req.get_uri_args() - http://wiki.nginx.org/HttpLuaModule#ngx.req.get_uri_args
post_args = ngx.req.get_post_args() - http://wiki.nginx.org/HttpLuaModule#ngx.req.get_post_args
ソケット= ngx.req.socket - http://wiki.nginx.org/HttpLuaModule#ngx.req.socket
- メソッド
リクエスト:read_body() - http://wiki.nginx.org/HttpLuaModule#ngx.req.read_body
リクエスト:get_uri_arg(名前、デフォルト)
リクエスト:get_post_arg(名前、デフォルト)
リクエスト:get_arg(名前、デフォルト)
リクエスト:GET_COOKIE(キー、復号化)
リクエスト:リライト(URI、ジャンプ) - http://wiki.nginx.org/HttpLuaModule#ngx.req.set_uri
リクエスト:set_uri_args(引数) - http://wiki.nginx.org/HttpLuaModule#ngx.req.set_uri_args
プロパティとメソッド3.4レスポンスオブジェクト
- プロパティ
ヘッダ= ngx.header - http://wiki.nginx.org/HttpLuaModule#ngx.header.HEADER
- メソッド
応答:set_cookie(キー、値、暗号化、持続時間、経路)
応答:書き込み(コンテンツ)
応答:のwriteln(コンテンツ)
応答:LTP(テンプレート、データ)
応答:リダイレクト(URL、ステータス) - http://wiki.nginx.org/HttpLuaModule#ngx.redirect
応答:フィニッシュ() - http://wiki.nginx.org/HttpLuaModule#ngx.eof
応答:is_finished()
応答:延期(FUNC、...) - 応答が返された後に実行
3.5印刷デバッグログ
ngx.escape_uri(文字列)URLエスケープ
ngx.unescape_uri(文字列)URLエスケープ削減
クエリパラメータ文字列としてLuaのテーブルをコードngx.encode_args()
ngx.decode_args(STR、MAX_ARGS?)Luaのテーブルへのクエリ文字列