ChsHttpFcgiModule
[edit] 鎽 瑕
杩欎釜妯″潡鍏佽Nginx 涓嶧astCGI 杩涚▼浜や簰锛屽苟閫氳繃浼犻掑弬鏁版潵鎺у埗FastCGI 杩涚▼宸ヤ綔銆
閰嶇疆瀹炰緥:
location / { fastcgi_pass localhost:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /home/www/scripts/php$fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; }
璇硶锛
[edit] fastcgi_buffers
syntax: fastcgi_buffers the_number is_size; default: fastcgi_buffers 8 4k/8k; context: http, server, location 璇ユ寚浠ら泦璁剧疆缂撳啿鍖虹殑鏁伴噺鍜屽ぇ灏忥紝鐢ㄤ簬缂撳瓨浠 FastCGI Server 鎺ユ敹鍒扮殑鏁版嵁銆傞粯璁ゆ儏鍐典笅锛屼竴涓紦鍐插尯鐨勫ぇ灏忕浉褰撲簬涓涓〉闈㈢殑澶у皬銆傛牴鎹钩鍙扮殑涓嶅悓璁剧疆涓4K/8K
[edit] fastcgi_buffer_size
璇硶: fastcgi_buffer_size 澶у皬
榛樿: fastcgi_buffer_size 4k/8k
鐜: http, server, location
璇ュ懡浠よ缃紦鍐插尯澶у皬锛屽叾涓皢璇诲彇绗竴閮ㄥ垎鐨勮緭鍑猴紝浠巉astcgi鏈嶅姟绔幏鍙
鍦ㄨ繖涓緭鍑虹殑灏忚緭鍑烘爣澶撮儴鍒嗙殑浣嶇疆锛屼綔涓轰竴椤硅鍒
榛樿鎯呭喌涓嬶紝缂撳啿鍖哄ぇ灏忔槸绛変簬涓涓猣astcgi缂撳啿鍖哄ぇ灏忥紝鍏佽灏嗗叾璁剧疆涓烘洿灏
[edit] fastcgi_cache
syntax: fastcgi_cache zone;
default: none
context: http, server, location
璁剧疆缂撳瓨鍦ㄥ叡浜唴瀛樹腑鐨勫悕绉. 涓鍧楀尯鍩熷彲浠ヨ鐢ㄤ簬涓嶇敤鐨勫湴鏂.
[edit] fastcgi_cache_key
syntax: fastcgi_cache_key line ;
default: none
context: http, server, location
璁剧疆缂撳瓨鐨刱ey, 渚:
fastcgi_cache_key localhost: 9000 $ request_uri;
[edit] fastcgi_cache_methods
璇硶: fastcgi_cache_methods [GET HEAD POST];
榛樿: fastcgi_cache_methods GET HEAD;
鐜: main,http,location
GET/HEAD 璇硶绯, 涔熷氨鏄. 鍗充娇浣犲垰鍒氳缃紝涔熸棤娉曠鐢 GET/HEAD
fastcgi_cache_methods POST;
[edit] fastcgi_cache_min_uses
syntax: fastcgi_cache_min_uses n
default: fastcgi_cache_min_uses 1
context: http, server, location
TODO: Description.
[edit] fastcgi_cache_path
syntax: fastcgi_cache_path /path/to/cache [levels=m:n keys_zone=name:time inactive=time clean_time=time]
default: none
context: http, server, location
TODO: Description.
[edit] fastcgi_cache_use_stale
syntax: fastcgi_cache_use_stale [updating|error|timeout|invalid_header|http_500] default: fastcgi_cache_use_stale off; context: http, server, location TODO: Description.
[edit] fastcgi_cache_valid
syntax: fastcgi_cache_valid [http_error_code|time] default: none context: http, server, location TODO: Description.
[edit] fastcgi_index
syntax: fastcgi_index file default: none context: http, server, location The name of the file which will be appended to the URI and stored in the variable $fastcgi_script_name if URI concludes with a slash.
[edit] fastcgi_hide_header
syntax: fastcgi_hide_header name context: http, server, location 榛樿鎯呭喌涓婲ginx 涓嶄細浠嶧astCGI 杩涚▼閲岀粰瀹㈡埛绔彂閫"Status" 鍜"X-Accel-..." 娑堟伅澶淬傝繖涓寚浠ゅ彲浠ョ敤鏉ユ帺楗板埆鐨刪eaders 銆 濡傛灉闇瑕"Status" 鍜"X-Accel-..." 娑堟伅澶达紝閭e氨闇瑕佷娇鐢ㄨ繖涓寚浠よFastCGI 寮哄埗鍙戦佹秷鎭ご缁欏鎴风銆
[edit] fastcgi_ignore_client_abort
syntax: fastcgi_ignore_client_abort on|off default: fastcgi_ignore_client_abort off context: http, server, location 杩欎釜鎸囦护鐢ㄦ潵鍐冲畾蹇界暐鐢ㄦ埛鍙栨秷鐨勮姹傘
[edit] fastcgi_intercept_errors
syntax: fastcgi_intercept_errors on|off default: fastcgi_intercept_errors off context: http, server, location 杩欎釜鎸囦护鐢ㄦ潵鍐冲畾鏄惁瑕佹妸瀹㈡埛绔浆鍚4xx鍜5xx閿欒椤碉紝鎴栧厑璁窷ginx鑷姩鎸囧畾閿欒椤甸〉銆 娉ㄦ剰锛氫綘闇瑕佸湪姝ゆ槑纭敊璇〉,瀹冩墠鏄湁鐢ㄧ殑銆侷gor 鏇捐锛氣滃鏋滄病鏈夊畾鍒剁殑澶勭悊鏈哄埗锛孨ginx涓嶄細鎷︽埅涓涓病鏈夌己鐪侀〉鐨勯敊璇侼ginx 鍙細鎷︽埅涓浜涘皬鐨勯敊璇紝鏀捐繃鍏朵粬涓浜涖
[edit] fastcgi_param
syntax: fastcgi_param parameter value default: none context: http, server, location 璇ユ寚浠ゆ寚瀹氱殑鍙傛暟,灏嗚浼犻掔粰FastCGI-server銆 瀹冨彲鑳戒娇鐢ㄥ瓧绗︿覆銆佸彉閲忓強鍏跺畠浠殑缁勫悎鏉ヤ綔涓哄弬鏁板笺傚鏋滀笉鍦ㄦ鍒跺畾鍙傛暟锛屽畠灏变細缁ф壙澶栧眰璁剧疆锛涘鏋滃湪姝よ缃簡鍙傛暟锛屽皢娓呴櫎澶栧眰鐩稿叧璁剧疆锛屼粎鍚敤鏈眰璁剧疆銆 涓嬮潰鏄竴涓緥瀛,瀵逛簬PHP鏉ヨ鐨勬渶绮剧畝鐨勫繀瑕佸弬鏁帮細 fastcgi_param SCRIPT_FILENAME /home/www/scripts/php$fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; 鍙傛暟SCRIPT_FILENAME 鏄疨HP 鐢ㄦ潵纭畾鎵ц鑴氭湰鐨勫悕瀛楋紝鑰屽弬鏁癚UERY_STRING 鏄畠鐨勪竴涓瓙鍙傛暟銆 濡傛灉瑕佸鐞哖OST,閭d箞杩欎笁涓檮鍔犲弬鏁版槸蹇呰鐨勶細 fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; 濡傛灉PHP 鍦ㄧ紪璇戞椂浣跨敤浜--enable-force-cgi-redirect閫夐」锛岃缃弬鏁癛EDIRECT_STATUS 鐨勫间负200灏辨槸蹇呴』鐨勪簡銆 fastcgi_param REDIRECT_STATUS 200;