1 http { 2 3 log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 4 '$status $body_bytes_sent "$http_referer" ' 5 '"$http_user_ag.....
分类:
其他好文 时间:
2015-01-23 17:43:53
阅读次数:
169
本篇文章由:http://xinpure.com/php-based-on-information-such-as-the-ip-address-in-your-city/获得IP地址在 PHP 中得到当前访问者的IP地址,还是比较简单的: $ip = $_SERVER['REMOTE_ADDR']...
分类:
Web程序 时间:
2015-01-22 00:06:54
阅读次数:
214
#include #include #include #include #include #include int main(int argc, char *argv[]){ int client_sockfd; int len; struct sockaddr_in remote_addr; //...
分类:
其他好文 时间:
2015-01-19 22:35:20
阅读次数:
125
背景:有时程序偶出现参数少了或没有提交到下一个链接Url里后出现问题,如何查呢,最好的办法是在nginx上的加post参数,以定位到问题才有可能对某个UIR的代码出现的问题进行排查。og_format access '$remote_addr - $remote_user [$time_local]...
分类:
数据库 时间:
2015-01-19 14:04:31
阅读次数:
276
Mark一下
function WriteIPMark($strFile)
{
$ip=$_SERVER["REMOTE_ADDR"];
$str_date = date('Y-m-d H:i:s',time());
$fp = fopen($strFile, "a");
if($fp)
{
fwrite($fp,$ip);
fwrite($fp," ");
...
分类:
Web程序 时间:
2015-01-14 21:27:48
阅读次数:
213
第一种:Request.UserHostAddress; //获取IP第二种:HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];第三种是获取部署地址的IP: string strHostName = System.Net.Dns.....
分类:
Web程序 时间:
2015-01-05 18:18:46
阅读次数:
161
原理 就是用SET变量进行。AND 就用变量叠加,OR就用0或1切换。nginx的配置中不支持if条件的逻辑与/逻辑或运算 ,并且不支持if的嵌套语法,我们可以用变量的方式来实现:首先是伪代码(即不被nginx支持),写在这里只是为了方便理解:if ($remote_addr ~ "^(12.34|...
分类:
其他好文 时间:
2014-12-22 22:27:57
阅读次数:
674
private function _get_client_ip() { $ip = $_SERVER['REMOTE_ADDR']; if (isset($_SERVER['HTTP_CLIENT_IP']) && preg_match('/^([0-9]{1,3}\...
分类:
Web程序 时间:
2014-12-09 12:05:49
阅读次数:
269
log_format main '$remote_addr - $remote_user [$time_local] $request ' '"$status" $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http...
分类:
其他好文 时间:
2014-11-26 20:27:28
阅读次数:
187
if($cookie_say!="hbnl"){add_headerSet-Cookie"say=hbnl";rewrite.*"$scheme://$host$uri"redirect;}if($cookie_say!="hbnl$remote_addr"){add_headerSet-Cookie"say=hbnl$remote_addr";rewrite.*"$scheme://$host$uri"redirect;}rewrite_by_lua‘localrandom=ngx.var.cookie_r..
分类:
其他好文 时间:
2014-11-24 13:47:19
阅读次数:
300