当前位置:  操作系统/服务器>linux
本页文章导读:
    ▪Nginx中全局变量整理小结       Variables The core module supports built-in variables, whose names correspond with the names of variables in Apache. First of all, there are the variables, which represent the lines of the title of the client request, for example, $http_user_agent, $.........
    ▪IP安全策略限制IP进入远程桌面设置方法       第一步:添加允许的IP段 开始,运行,gpedit.msc,计算机配置,Windows设置,安全设置,IP安全策略,常来网专用IP安全策略,双击打开的,再双击打开的,然后点添加,点下一步,输入描述.........
    ▪Apache下MP3 防盗链的解决办法       今天说的这个办法是通过Apache的Mod_Rewrite功能来实现的,代码写在.htaccess文件里面,示例如下: 代码如下: RewriteEngine on RewriteCond %{HTTP_REFERER} !^http://(www\.)?jb51\.net/.*$ [NC] RewriteRule \.(mp3|rar)$ ht.........

[1]Nginx中全局变量整理小结
    来源: 互联网  发布时间: 2013-12-24

Variables

The core module supports built-in variables, whose names correspond with the names of variables in Apache.

First of all, there are the variables, which represent the lines of the title of the client request, for example, $http_user_agent, $http_cookie, and so forth.

Furthermore, there are other variables:
Edit section: $arg_PARAMETER $arg_PARAMETER

This variable contains the value of the GET request variable PARAMETER if present in the query string
Edit section: $args $args

This variable is equal to arguments in the line of request;
Edit section: $binary_remote_addr $binary_remote_addr

The address of the client in binary form;
Edit section: $body_bytes_sent $body_bytes_sent

(undocumented)
Edit section: $content_length $content_length

This variable is equal to line Content-Length in the header of request;
Edit section: $content_type $content_type

This variable is equal to line Content-Type in the header of request;
Edit section: $cookie_COOKIE $cookie_COOKIE

The value of the cookie COOKIE;
Edit section: $document_root $document_root

This variable is equal to the value of directive root for the current request;
Edit section: $document_uri $document_uri

The same as $uri.
Edit section: $host $host

This variable is equal to line Host in the header of request or name of the server processing the request if the Host header is not available.

This variable may have a different value from $http_host when the Host input header is absent or has an empty value.
Edit section: $http_HEADER $http_HEADER

The value of the HTTP header HEADER when converted to lowercase and with ‘dashes' converted to ‘underscores', e.g. $http_user_agent, $http_referer…;
Edit section: $is_args $is_args

Evaluates to “?” if $args is set, “” otherwise.
Edit section: $limit_rate $limit_rate

This variable allows limiting the connection rate.
Edit section: $query_string $query_string

The same as $args.
Edit section: $remote_addr $remote_addr

The address of the client.
Edit section: $remote_port $remote_port

The port of the client;
Edit section: $remote_user $remote_user

This variable is equal to the name of user, authenticated by the Auth Basic Module;
Edit section: $request_filename $request_filename

This variable is equal to path to the file for the current request, formed from directives root or alias and URI request;
Edit section: $request_body $request_body

This variable(0.7.58+) contains the body of the request. The significance of this variable appears in locations with directives proxy_pass or fastcgi_pass.
Edit section: $request_body_file $request_body_file

Client request body temporary filename;
Edit section: $request_completion $request_completion

(undocumented)
Edit section: $request_method $request_method

This variable is equal to the method of request, usually GET or POST.

Before and including 0.8.20, this variable always evaluates to the method name of the main request, not the current request if the current request is a subrequest.
Edit section: $request_uri $request_uri

This variable is equal to the complete initial URI together with the arguments;
Edit section: $scheme $scheme

The HTTP scheme (i.e. http, https). Evaluated only on demand, for example:

rewrite ^(.+)$ $scheme://example.com$1 redirect;

Edit section: $server_addr $server_addr

Equal to the server address. As a rule, for obtaining the value of this variable is done one system call. In order to avoid system call, it is necessary to indicate addresses in directives listen and to use parameter bind.
Edit section: $server_name $server_name

The name of the server.
Edit section: $server_port $server_port

This variable is equal to the port of the server, to which the request arrived;
Edit section: $server_protocol $server_protocol

This variable is equal to the protocol of request, usually this HTTP/1.0 or HTTP/1.1.
Edit section: $uri $uri

This variable is equal to current URI in the request, it can differ from initial, for example by internal redirects, or with the use of index it is file with internal redirects.

参考:

http://www.givingtree.com.cn/entry/Nginx-Location%E5%9F%BA%E6%9C%AC%E8%AF%AD%E6%B3%95

http://wiki.nginx.org/NginxHttpCoreModule#Variables

$args 此变量与请求行中的参数相等

$content_length 等于请求行的“Content_Length”的值。

$content_type 等同与请求头部的”Content_Type”的值

$document_root 等同于当前请求的root指令指定的值

$document_uri 与$uri一样

$host 与请求头部中“Host”行指定的值或是request到达的server的名字(没有Host行)一样

$limit_rate 允许限制的连接速率

$request_method 等同于request的method,通常是“GET”或“POST”

$remote_addr 客户端ip

$remote_port 客户端port

$remote_user 等同于用户名,由ngx_http_auth_basic_module认证

$request_filename 当前请求的文件的路径名,由root或alias和URI request组合而成

$request_body_file

$request_uri 含有参数的完整的初始URI

$query_string 与$args一样

$server_protocol 等同于request的协议,使用“HTTP/1.0”或“HTTP/1.1”

$server_addr request到达的server的ip,一般获得此变量的值的目的是进行系统调用。为了避免系统调用,有必要在listen指令中指明ip,并使用bind参数。

$server_name 请求到达的服务器名

$server_port 请求到达的服务器的端口号

$uri 等同于当前request中的URI,可不同于初始值,例如内部重定向时或使用index


    
[2]IP安全策略限制IP进入远程桌面设置方法
    来源: 互联网  发布时间: 2013-12-24
第一步:添加允许的IP段

开始,运行,gpedit.msc,计算机配置,Windows设置,安全设置,IP安全策略,常来网专用IP安全策略,双击打开的,再双击打开的,然后点添加,点下一步,输入描述,下一步,源地址选一个特定的IP子网,下面的IP地址输入,如您的服务器IP是61.164.140.43,则输入61.164.140.0,下面的子网掩码输入255.255.255.0,然后点下一步,目标地址点选我的IP地址,下一步,协议类型选任意,再点下一步,然后点完成,再然后一直点确定,直到又回到组策略的窗口,然后关闭就可以了!

第二步:拒绝所有IP段连接至3389端口

开始,运行,gpedit.msc,计算机配置,Windows设置,安全设置,IP安全策略,常来网专用IP安全策略,双击关闭的,再双击关闭的,然后点添加,点下一步,输入描述,下一步,源地址选任何IP地址,下一步,目标地址选我的IP地址,下一步,选择协议类型为TCP再点下一步,上方的从任意端口默认不变,下面的到此端口点上然后填入3389,再点下一步,点完成,再点确定,再点关闭,点应用,再点确定完毕!

PS:如果您的IP地址是经常变的ADSL可以在允许的网段里把您经常用的几个网段都加上,如IP是123.6.71.231,只需要把上面的允许的IP段里的IP61.164.140.0换成123.6.0.0,因为ADSL后面两位的数字经常变但前两位是不经常变的!子网掩码输入255.255.0.0,然后其他的操作都一样!

    
[3]Apache下MP3 防盗链的解决办法
    来源: 互联网  发布时间: 2013-12-24
今天说的这个办法是通过Apache的Mod_Rewrite功能来实现的,代码写在.htaccess文件里面,示例如下:
代码如下:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://(www\.)?jb51\.net/.*$ [NC]
RewriteRule \.(mp3|rar)$ http://www./ [R=301,L]

想使用这段代码的朋友,请把里面的网址改成你自己的网址即可。

    
最新技术文章:
▪linux系统中的列出敏感用户的脚本代码
▪a10 config backup for aXAPI
▪一键备份gitolite服务器的Shell脚本
▪nagios 分发文件实现代码
▪阿里云云服务器Linux系统更新yum源Shell脚本
▪一个监控LINUX目录和文件变化的Shell脚本分享
▪Linux下实现SSH免密码登录和实现秘钥的管理、...
▪Shell正则表达式之grep、sed、awk实操笔记
▪3个备份系统文件并邮件发送的Shell脚本分享
▪CentOS 6.3下给PHP添加mssql扩展模块教程
▪监控网站是否可以正常打开的Shell脚本分享
▪shell脚本编程之if语句学习笔记
▪shell脚本编程之循环语句学习笔记
▪shell脚本编程之case语句学习笔记
▪Shell脚本实现的阳历转农历代码分享
▪Shell脚本实现复制文件到多台服务器的代码分...
▪Shell脚本实现批量下载网络图片代码分享
▪Shell脚本实现检测文件是否被修改过代码分享
▪Shell脚本数组用法小结
▪Shell脚本批量重命名文件后缀的3种实现
▪C语言实现的ls命令源码分享
▪Linux下查找后门程序 CentOS 查后门程序的shell脚...
▪Shell 函数参数
▪linux shell 自定义函数方法(定义、返回值、变...
▪Shell实现判断进程是否存在并重新启动脚本分...
▪Shell脚本break和continue命令简明教程
▪Shell脚本函数定义和函数参数
▪让代码整洁、过程清晰的BASH Shell编程技巧
▪shell常用重定向实例讲解
▪awk中RS、ORS、FS、OFS的区别和联系小结
 


站内导航:


特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

©2012-2021,,E-mail:www_#163.com(请将#改为@)

浙ICP备11055608号-3