WEB application

Compilation and installation of zabbix monitoring in lnmp environment

WEB application

Notes on the configuration of the vcl of Varnish, an http accelerator (lnmp environment)

WEB application

Compilation, installation, upgrade and WordPress problem solving sharing of the official version of PHP 7.0

WEB application

Notes on the installation of HTTP accelerator varnish (1)

WEB application

WordPress enables memcached dynamic caching and error resolution

June 17, 2022

Flyer: a lightweight API development framework based on FastAPI

two thousand eight hundred and fourteen zero
Overview We often hear that "the operation and maintenance that will not be developed is not a good luck maintenance". Indeed, in the operation and maintenance work, skilled development experience can make the operation and maintenance work like a duck in water and get twice the result with half the effort! In addition to mastering shell script programming, advanced O&M needs to master a high-level language, such as Python Golang, PHP, Lua, etc. In addition to solving some more complex O&M scenarios, high-level language can also help us better understand the business and do a good job in business O&M, after all, only knowing ourselves and the other can win a hundred battles. I often see many O&M students write interfaces
March 18, 2022

APISIX Advanced Routing 301/302 Jump Configuration

two thousand eight hundred and fifty-six zero
We have an internal website that supports access to two domains at the same time. Recently, due to the need for upgrading, we hope to unify to one domain name, that is, the old domain name will make a 301 jump to the new domain name. You can directly configure an if logic in Nginx, judge the old host and jump to the new domain name. How should this case be configured in APISIX? After looking at the APISIX document, we found that there are two jump plug-ins: redirect and response rewrite. The former can only jump to the uri but not to the protocol host. The latter can modify the return header
February 25 · 2022

Share a typical case of an APISIX gateway returning 502

one thousand six hundred and eighty-four zero
In order to improve the performance of APISIX, the keepalived feature is turned on by default. The default session retention time is 60s. When we deploy the gateway, we also retain this optimization feature. It happens that my upstream service is based on the Gunicorn+FastAPI development framework, and keepalived is also turned on. The default setting for session retention is 5s. There is a problem: within 60 seconds after the gateway and the upstream service establish a connection, the new request will continue to reuse the connection, but the upstream actively closes the connection after 5 seconds, because when the gateway forwards the new request to the upstream, it finds that the connection has been closed, so the above error occurs
December 12, 2021

APISIX O&M optimization solves the problem of long tail requests (time-consuming jitter)

two thousand seven hundred and seventy-one zero
Since APISIX gateway was popularized and used, there have been many production business accesses in our department. One day, he was pulled into a problem group and was told that there was a problem with the performance of APISIX gateway, and the overall performance was not as good as the previous ZUUL gateway. what? APISIX's performance can't be worse than ZUUL's, can it? Don't talk nonsense. I got a serial request and compared it with the APISIX gateway and the ZUUL gateway in the production environment. The result was surprising! Normally, APISIX takes more time than ZUUL gateway, but AP
November 14, 2021

APISIX O&M Optimization Configuration File Automatic Generation Scheme

three thousand four hundred and six zero
Configure APISIX in Configmap mode. At the beginning, we used Configmap to deploy APISIX on Tencent Cloud TKE. When the network area becomes more and more open, each TKE cluster needs to define a set of Configmap corresponding to config.yaml, which is very cumbersome to manage. Therefore, here we use Python's Jinja2 plug-in to automatically render APISIX configuration files, which is very convenient on the whole
November 7, 2021

Hong Gateway HMAC Authentication Plug in developed by APISIX Plug in (client SDK attached)

one thousand six hundred and fifty-six zero
Before deciding to fully roll out the use of APISIX, The Kong Gateway has been tried in our production environment for nearly a year, so a large number of API interfaces in the production environment use Kong HMAC authentication. This time, we migrated to the APISIX gateway. In order to reduce the transformation work of the client, we decided to migrate the HMAC authentication plug-in of the Kong gateway to APISIX, and at the same time, take the HMAC authentication of Hong as the unified authentication scheme of the subsequent API interface
November 3, 2021

APISIX plug-in development refined speed limiting plug-in

two thousand seven hundred and thirty-seven zero
In actual business scenarios, The APISIX speed limit is too general to meet the business requirements. In the end, we modified ourselves on the basis of the limit count plug-in and redesigned a speed limit mechanism to set differentiated access speed limits for different consumers based on different services to meet the more refined speed limit requirements of the production environment
October 28, 2021

APISIX Advanced Routing Forwards requests through the Body parameter

three thousand nine hundred and fourteen zero
APISIX's advanced routing is very powerful. You can do forwarding routing based on arbitrary variables, such as header Cookie, querystring parameters, etc. There is a very abnormal usage in our history: routing based on the value of a parameter in the Body, that is, different values should be forwarded to different backend IPs: PORT (this problem is mainly due to lazy service splitting, which does not promote the tail left by the client's modification request)
July 7, 2019

CloudFlare Edge Computing Workers: Blog Jumps to the Middle Page

three thousand two hundred and fifty-six forty-two
On April 27, I was lucky to participate in the Meng Xin, a big bull of CloudFlare, gave a lecture on the course "The Latest Edge API of CloudFlare, Creating a Serverless Architecture", which was very fruitful. Because this course is very grounded, and most of the content is in practice, rather than some people who just talk about theory and spell out PPT when sharing, they are confused. When sharing, it is the same way, but when you really try it, it is a different way, duang~, Of course, another reason is that Zhang Ge's blog is also using Clos
May 2, 2019

Share an alternative application case of Nginx reverse proxy

six thousand three hundred and forty-six thirty-seven
In front of the blog, I shared an article, "Sharing an Alternative Application Case of Nginx Forward Agent". Not long after that, as a firefighter, the blogger received another "F" request for "W" type, "T" type, and "F" type. The scenario is similar to the last time, and it is also a third-party application introduced by the department. It is deployed in various network areas and cannot be directly accessed from the OA office area. At present, operators need to log in to the Windows springboard machine to open the WEB console of these applications. It is not convenient, and there is a certain amount of maintenance work for Windows servers, so we found our team
April 12, 2019

Surprisingly, Haproxy repeatedly added X-Forwarded-For problem (with official solutions)

four thousand four hundred and thirty-nine seven
Recently, when configuring the Haproxy proxy, I found a very interesting thing: Haproxy will add an X-Forwarded-For (hereinafter referred to as XFF) to proxy http requests without thinking, instead of adding its own IP address to the existing XFF list, WTF! And this divine operation? After confirmation, I opened an issue at the github of Haproxy and fed back the bug (issue address). Finally, I learned that Haproxy was designed in this way and got a solution
January 20, 2019

Share an alternative application case of Nginx forward proxy

two thousand nine hundred and thirty-six thirteen
Recently, I received a request to replace a self developed agent program on the current network through Nginx agent. It's interesting and profitable. Let's share it briefly. The production environment of the demand background department is extremely complex. Some systems introduced by third parties are located in special network isolation areas. Requests for these systems need to go through the 2-layer network agent, as shown in the figure: The central source system requests the target system API in different forms. I simply collected the following three types: curl -- digest - u admin: xxxxxx