当前位置: 首页 > news >正文

网站建设中添加图片链接户县微网站建设

网站建设中添加图片链接,户县微网站建设,网站制作中英文天津,网站建设xs029目录 $remote_addr 变量 $args 变量 $is_args 变量 $document_root 变量 $document_uri 变量 $host 变量 $limit_rate 变量 $remote_port 变量 $remote_port --显示客户端端口 $request_method 变量 --返回请求方式 $request_filename 变量 --返回请求实际路径 $request_uri…

目录

$remote_addr 变量

$args 变量

$is_args 变量

$document_root 变量

$document_uri 变量

$host 变量

$limit_rate 变量

$remote_port  变量

$remote_port --显示客户端端口

$request_method 变量  --返回请求方式

$request_filename 变量 --返回请求实际路径

$request_uri;  变量 --返回document_uri 与 args

$server_protocol  变量 -- 服务端协议

$server_addr  变量  -- 服务器地址

$server_name -- 虚拟主机名称

$server_port  -- 访问主机端口

$http_cookie  -- 返回cookie值

$cookie_<name>

多变量组合成URL


变量描述
$remote_addr
存放了客户端的地址,注意是客户端的公网 IP
$args

URL 中的所有查询参数。

例如:https://example.com/search?query=test&enc=utf-8

返回 query=test&enc=utf-8

$is_args如果 URL 中有查询参数,则为 ?,否则为空。
$document_root当前请求的系统根目录。例如:/webdata/nginx/timinglee.org/lee
$document_uri当前请求中不包含查询参数的 URI。例如:/var
$host请求的 Host 名称。
$limit_rate如果设置了 limit_rate,则显示限制的网络速率,否则为 0
$remote_port客户端请求 Nginx 服务器时使用的端口。
$remote_user经过 Auth Basic Module 验证的用户名。
$request_body_file反向代理时发给后端服务器的本地资源文件名。
$request_method请求的方法(例如:GET, PUT, DELETE 等)。
$request_filename当前请求的资源文件的磁盘路径。
$request_uri包含查询参数的原始 URI,不包含主机名。例如:/main/index.do?id=20190221&partner=search
$scheme请求的协议(例如:http, https, ftp 等)。
$server_protocol客户端请求资源使用的协议版本(例如:HTTP/1.0, HTTP/1.1, HTTP/2.0 等)。
$server_addr服务器的 IP 地址。
$server_name虚拟主机的主机名。
$server_port虚拟主机的端口号。
$http_user_agent客户端浏览器的详细信息。
$http_cookie客户端的所有 Cookie 信息。
$cookie_<name>请求报文中特定 Cookie 的值,<name> 替换为 Cookie 的名称。
$http_<name>记录请求报文的首部字段,<name> 替换为首部字段的小写形式,横线替换为下划线。

示例

$remote_addr 变量

[root@RHEL-9 conf.d]# vim /usr/local/nginx/conf.d/var.conf 
server {listen 80;server_name var.shuyan.com;root /data/web/html;index index.html;location /var {default_type text/html;echo $remote_addr;}[root@RHEL-9 conf.d]# systemctl restart nginx# 客户端访问
[root@docker-rhel ~]# curl var.shuyan.com/var
192.168.239.50

$args 变量

[root@RHEL-9 conf.d]# vim var.conf 
server {listen 80;server_name var.shuyan.com;root /data/web/html;index index.html;location /var {default_type text/html;echo $remote_addr;echo $args;}
[root@RHEL-9 conf.d]# nginx -s reload# 客户端测试 $args 匹配? 后面的值
[root@docker-rhel ~]# curl var.shuyan.com/var?name=111www=123
192.168.239.50
name=111www=123

$is_args 变量

$document_root 变量

[root@RHEL-9 conf.d]# vim var.conf 
server {listen 80;server_name var.shuyan.com;root /data/web/html;index index.html;location /var {default_type text/html;echo $remote_addr;echo $args;echo $is_args;echo $document_root;}[root@RHEL-9 conf.d]# nginx -s reload

实现效果

$document_uri 变量

[root@RHEL-9 conf.d]# vim var.conf 
server {listen 80;server_name var.shuyan.com;root /data/web/html;index index.html;location /var {default_type text/html;echo $remote_addr;echo $args;echo $is_args;echo $document_root;echo $document_uri;}[root@RHEL-9 conf.d]# nginx -s reload

测试效果

实现效果

$host 变量

[root@RHEL-9 conf.d]# vim var.conf
server {listen 80;server_name var.shuyan.com;root /data/web/html;index index.html;location /var {default_type text/html;echo $remote_addr;echo $args;echo $is_args;echo $document_root;echo $document_uri;echo $document_root$document_uri;echo $host;}[root@RHEL-9 conf.d]# nginx -s reload

$limit_rate 变量

server {listen 80;server_name var.shuyan.com;root /data/web/html;index index.html;location /var {default_type text/html;echo $remote_addr;echo $args;echo $is_args;echo $document_root;echo $document_uri;echo $document_root$document_uri;echo $host;# 限速打印#如果nginx服务器使用limit_rate配置了显示网络速率,则会显示,如果没有设置, 则显示0echo $limit_rate;}

$remote_port  变量

server {listen 80;server_name var.shuyan.com;root /data/web/html;index index.html;location /var {default_type text/html;echo $remote_addr;echo $args;echo $is_args;echo $document_root;echo $document_uri;echo $document_root$document_uri;echo $host;echo $limit_rate;#客户端请求Nginx服务器时随机打开的端口,这是每个客户端自己的端口echo $remote_port;}

$remote_port --显示客户端端口

server {listen 80;server_name var.shuyan.com;root /data/web/html;index index.html;location /var {default_type text/html;echo $remote_addr;echo $args;echo $is_args;echo $document_root;echo $document_uri;echo $document_root$document_uri;echo $host;echo $limit_rate;echo $remote_port;# 已经经过Auth Basic Module验证的用户名echo $remote_user;}# 客户端测试
[root@docker-rhel ~]# curl -u shuyan:123456 var.shuyan.com/var?name=111www=123
192.168.239.50
name=111www=123
?
/data/web/html
/var
/data/web/html/var
var.shuyan.com
0
33194
shuyan

$request_method 变量  --返回请求方式

server {listen 80;server_name var.shuyan.com;root /data/web/html;index index.html;location /var {default_type text/html;echo $remote_addr;echo $args;echo $is_args;echo $document_root;echo $document_uri;echo $document_root$document_uri;echo $host;echo $limit_rate;echo $remote_port;echo $remote_user;# 返回请求资源的方式  GET/PUT/DELETE等echo $request_method;}

$request_filename 变量 --返回请求实际路径

server {listen 80;server_name var.shuyan.com;root /data/web/html;index index.html;location /var {default_type text/html;echo $remote_addr;echo $args;echo $is_args;echo $document_root;echo $document_uri;echo $document_root$document_uri;echo $host;echo $limit_rate;echo $remote_port;echo $remote_user;echo $request_method;# 当前请求的资源文件的磁盘路径,由root或alias指令与URI请求生成的文件绝对路径echo $request_filename;}[root@docker-rhel ~]# curl -u shuyan:123456 var.shuyan.com/var?name=111www=123
192.168.239.50
name=111www=123
?
/data/web/html
/var
/data/web/html/var
var.shuyan.com
0
33206
shuyan
GET
/data/web/html/var

$request_uri;  变量 --返回document_uri 与 args

# 包含请求参数的原始 URI ,不包含主机名,相当于 :$document_uri?$args,

$scheme 变量

$server_protocol  变量 -- 服务端协议

# 保存了客户端请求资源使用的协议的版本,例如 :HTTP/1.0 HTTP/1.1 HTTP/2.0

$server_addr  变量  -- 服务器地址

# 保存了服务器的 IP 地址

$server_name -- 虚拟主机名称

# 虚拟主机的主机名

$server_port  -- 访问主机端口

$http_user_agent
# 客户端浏览器的详细信息

$http_cookie  -- 返回cookie值

# 客户端的所有 cookie 信息

$cookie_<name>

#name 为任意请求报文首部字部 cookie key

$http_<name>

# name 为任意请求报文首部字段 , 表示记录请求报文的首部字段,n ame 的对应的首部字段名需要为小写,如果有 横线需要替换为下划线

多变量组合成URL

$scheme、$host、$document_uri、$args 

http://www.yayakq.cn/news/623195/

相关文章:

  • 淘宝做个网站多少钱网站做淘宝客有什么要求
  • 怎么才能找到想做网站建设的客源做网站的例子
  • 温州快建网站rewrite.php wordpress 缓存 固定连接
  • 做个网站得投入多少appstar官网
  • 网站特点扬州网站建设哪家公司好
  • 如何做行业平台网站怎样收录网站
  • 建网站需要学什么重庆建设工程安全信息管理网
  • 怎么做捕鱼网站通化县建设局网站
  • 服装网站建设的规模和类别wordpress 注册
  • 江苏建设培训网站手工制作大全废物利用
  • 合适的网站制作需要多少钱品牌建设理论包括哪些内容
  • 唐山软件开发公司排名百度seo竞价推广是什么
  • 做食物网站应该考虑些什么全国十大外贸平台
  • 泰安网站建设推广宝塔window搭建wordpress
  • 用别人的二级域名做网站广州网站开发创意设计
  • 高明做网站网站维护服务内容
  • react.js做的网站越秀做网站
  • 高端网站制作建设网站修改解析怎么做
  • 黄埔网站推广为什么网页总是打不开
  • 公司网站建设要多少钱漫画做视频在线观看网站
  • 卢龙建设银行官网网站红色大气企业网站
  • 支付公司网站建设会计分录个人网站建设
  • django 电商网站开发vi设计可以做哪方面的
  • 营销型网站改版设计网页
  • 盘锦做网站的公司网站开发客户需求
  • 网站关键词排名优化做一个属于自己的网页
  • 网站建设设计技术方案模板下载pc端自定义页设计与制作模板
  • 泰安肥城网站建设access 网站开发
  • 开县做网站信息流广告哪个平台好
  • 淘宝的网站怎么做的好处四川建设人才考试官网