In the previous lecture, we saw the high-performance web server Nginx, which takes up less resources and has high processing power. It is the first choice for building websites. Although Nginx has become the undisputed “king” of the web server field, it is not without its shortcomings. After all, it is already 15 years old. […]
Tag: openresty
Openresty implements dynamic IP banning through Lua+Redis
Request background In order to block certain crawlers or malicious users from making requests to the server, we need to establish a dynamic IP blacklist. For IPs in the blacklist, services will be denied. and can be set to invalidate 1. Install Openresty (compile and install) wget https://openresty.org/download/openresty-1.19.3.1.tar.gz # Unzip openresty tar -zxvf openresty-1.19.3.1.tar.gz Download […]
OpenResty uses leaky bucket algorithm to implement current limiting
Foreword Other project teams need to call the interface and add interface current limit to prevent the project from being crashed. Openresty is used in production, so we add per-interface current limiting on openresty. At the same time, we need to have different current limiting rules according to different interfaces, and use the leaky bucket […]
Openresty (twenty-one) ngx.balance and balance_by_lua grayscale release
1 openresty implements grayscale publishing ① Grayscale release Note: The ‘early’ blog interprets the ‘concepts’ released by ‘Grayscale’ and explains the grayscale implementation of ‘native nginx’ Follow-up: Mainly use the grayscale release of ‘node traffic’, and pay attention to the ‘gray grayscale strategy’ Related reference ② Review the HTTP reverse proxy process ngx_http_upstream Available ‘operation’ […]
Openresty (twenty-two) ngx.balance and balance_by_lua final chapter
1. Grayscale release paving the way ① init_by_lua* init_by_lua init_by_lua_block Features: Executed during openresty ‘start’, ‘reload’, and ‘restart’, belonging to the ‘master init’ phase Mechanism: nginx ‘master’ When the main process ‘loads the configuration file’, it runs the ‘Lua code’ specified by the parameters on the global Lua VM level. Scenario: Want to do a […]
Use openresty to create an IP address query interface
Foreword OpenResty is a high-performance web application server based on Nginx that integrates the Lua programming language to enable developers to quickly build flexible and scalable web applications. With OpenResty, you can take advantage of the powerful performance features of Nginx and the programming capabilities of Lua to handle complex business logic and achieve high […]
Openresty (Nginx) intranet installation, step-by-step detailed instruction + installation package attached
Openresty (nginx) configuration document 1. Basic Linux commands Check whether the nginx process is started: ps -ef | grep nginx Turn off the firewall: systemctl stop firewalld Open port 80: firewall-cmd –zone=public –add-port=80/tcp –permanent Close port 80: firewall-cmd –permanent –remove-port=80/tcp Check whether port 80 is open: firewall-cmd –query-port=80/tcp Reload the firewall: firewall-cmd –reload //Need to […]
Building a collection server based on OpenResty
OpenResty introduction OpenResty (also known as: ngx_openresty) is a scalable Web platform based on NGINX. It was initiated by Chinese Zhang Yichun and provides many high-quality third-party modules. OpenResty is a powerful web application server. Web developers can use the Lua scripting language to mobilize various C and Lua modules supported by Nginx. More importantly, […]
[openresty] Use JWT to implement token verification | Simulate registration and login process | RunnerGo automated testing
Article directory 1. What is JWT JWT components JWT Advantages 2. JWT installation & usage Add JWT library path 3. Install http client 4. Project code 5. RunnerGo automated testing interface 1. Create interface 2. Create a scene 3. Create automated tests 1. What is JWT JWT (JSON Web Token) is an open standard based […]
IP whitelist + time period access control based on openresty
1. Install openresty I won’t talk about installing openresty here. If you need it, you can go to the official website of openresty to see how to install it. It’s very simple. OpenResty? – Open Source Official Site 2. Project purpose The main reason is that I was asked to make an nginx access control […]