概述
nginx配置:
fastcgi_param
SCRIPT_FILENAME
$document_root$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;
fastcgi_param
HTTP_USER_AGENT
$http_user_agent;
fastcgi_param
SCRIPT_NAME
$fastcgi_script_name;
fastcgi_param
REQUEST_URI
$request_uri;
fastcgi_param
DOCUMENT_URI
$document_uri;
fastcgi_param
DOCUMENT_ROOT
$document_root;
fastcgi_param
SERVER_PROTOCOL
$server_protocol;
fastcgi_param
HTTP_HOST
$host;
fastcgi_param
GATEWAY_INTERFACE
CGI/1.1;
fastcgi_param
SERVER_SOFTWARE
nginx/$nginx_version;
fastcgi_param
REMOTE_ADDR
$remote_addr;
fastcgi_param
REMOTE_PORT
$remote_port;
fastcgi_param
SERVER_ADDR
$server_addr;
fastcgi_param
SERVER_PORT
$server_port;
fastcgi_param
SERVER_NAME
$server_name;
fastcgi_param
HTTP_CLIENTIP
$remote_addr;
fastcgi_param
SCRIPT_URL
$request_uri;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param
REDIRECT_STATUS
200
location / {
root /home/fangfang/runroot;
rewrite ^/(.*)$ /index_9299.php?route=$1 break;
fastcgi_pass
phpserver;
}
请求:127.0.0.1:8282/ff?name=ff
变量值:
request:GET /ff?name=ff HTTP/1.0
uri:/index_9299.php
request_uri:/ff?name=ff
document_uri:/index_9299.php
request_filename:/home/fangfang/runroot/index_9299.php
args:route=ff&name=ff
query_string:route=ff&name=ff
SCRIPT_FILENAME:/home/fangfang/runroot/index_9299.php(此参数决定了php路径)
uri和request_uri的区别是前者随着rewrite改变,而后者不改变,现我还没有在nginx找到表示url:/ff的变量。
最后
以上就是还单身星月为你收集整理的nginx request的几个变量的全部内容,希望文章能够帮你解决nginx request的几个变量所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复