<code>fastcgi_param SCRIPT_FILENAME <span>$document_root</span><span>$fastcgi_script_name</span>;<span>#脚本文件请求的路径</span> fastcgi_param QUERY_STRING <span>$query_string</span>; <span>#请求的参数;如?app=123</span> fastcgi_param REQUEST_METHOD <span>$request_method</span>; <span>#请求的动作(GET,POST)</span> fastcgi_param CONTENT_TYPE <span>$content_type</span>; <span>#请求头中的Content-Type字段</span> fastcgi_param CONTENT_LENGTH <span>$content_length</span>; <span>#请求头中的Content-length字段。</span>fastcgi_param SCRIPT_NAME <span>$fastcgi_script_name</span>; <span>#脚本名称 </span> fastcgi_param REQUEST_URI <span>$request_uri</span>; <span>#请求的地址不带参数</span> fastcgi_param DOCUMENT_URI <span>$document_uri</span>; <span>#与$uri相同。 </span> fastcgi_param DOCUMENT_ROOT <span>$document_root</span>; <span>#网站的根目录。在server配置中root指令中指定的值 </span> fastcgi_param SERVER_PROTOCOL <span>$server_protocol</span>; <span>#请求使用的协议,通常是HTTP/1.0或HTTP/1.1。 </span>fastcgi_param GATEWAY_INTERFACE CGI/<span>1.1</span>;<span>#cgi 版本</span> fastcgi_param SERVER_SOFTWARE nginx/<span>$nginx_version</span>;<span>#nginx 版本号,可修改、隐藏</span>fastcgi_param REMOTE_ADDR <span>$remote_addr</span>; <span>#客户端IP</span> fastcgi_param REMOTE_PORT <span>$remote_port</span>; <span>#客户端端口</span> fastcgi_param SERVER_ADDR <span>$server_addr</span>; <span>#服务器IP地址</span> fastcgi_param SERVER_PORT <span>$server_port</span>; <span>#服务器端口</span> fastcgi_param SERVER_NAME <span>$server_name</span>; <span>#服务器名,域名在server配置中指定的server_name</span><span>#fastcgi_param PATH_INFO $path_info;#可自定义变量</span><span># PHP only, required if PHP was built with --enable-force-cgi-redirect</span><span>#fastcgi_param REDIRECT_STATUS 200;</span>在php可打印出上面的服务环境变量 如:<span>echo</span><span>$_SERVER</span>[<span>'REMOTE_ADDR'</span>]</code>
以上就介绍了Nginx:fastcgi_param详解,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。