从Yaf框架思考统一入口带来的问题

2021-01-26  本文已影响0人  小石桥胡同

从Yaf框架思考统一入口带来的问题

背景介绍

      最近同事反馈说海外的短信费用异常,迅速打开Kibana,搜索相关的接口访问情况,立马发现发送短信接口同比前几天情况,异常的增多,虽然1-2分钟发送一条,但是架不住短信费用是用欧元结算的,短信费是蹭蹭的涨,所以立马开始排查解决。

问题解决

 map $http_x_forwarded_for  $clientRealIp {
     ""      $remote_addr;
     ~^(?P<firstAddr>[0-9\.]+),?.*$  $firstAddr;
 }

if ($clientRealIp ~* "159.2.7.3|15.46.20.23") {
        return 200;
        break;
}
Kibana.png
location ~ \.php$ {
     fastcgi_pass xxx;
     fastcgi_index index.php;
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
     include fastcgi_params;
}
    $request_uri
    This variable is equal to the *original* request URI as received from the client including the args. It cannot be modified. Look at $uri for the post-rewrite/altered URI. Does not include host name. Example: "/foo/bar.php?arg=baz"**** 
    这个变量等于从客户端发送来的原生请求URI,包括参数。它不可以进行修改。$uri变量反映的是重写后/改变的URI。不包括主机名。例如:"/foo/bar.php?arg=baz"
    $uri
    This variable is the current request URI, without any arguments (see $args for those). This variable will reflect any modifications done so far by internal redirects or the index module. Note this may be different from $request_uri, as $request_uri is what was originally sent by the browser before any such modifications. Does not include the protocol or host name. Example: /foo/bar.html
    这个变量指当前的请求URI,不包括任何参数(见$args)。这个变量反映任何内部重定向或index模块所做的修改。注意,这和$request_uri不同,因$request_uri是浏览器发起的不做任何修改的原生URI。不包括协议及主机名。例如:"/foo/bar.html"

问题思考

Yaf这种index.php设计带来的问题

如何设计统一网关

上一篇 下一篇

猜你喜欢

热点阅读