nginx/nginx is the official open source repository of NGINX. NGINX is not a new project for many operation and maintenance and back-end development, but it is normal for it to appear in Trending for a long time: it is still the infrastructure of web servers, reverse proxies, load balancing and caching layers.
If you have deployed websites, APIs, static resources, Docker services or intranet applications, you have most likely come across NGINX.
What it mainly does
Common uses for NGINX include:
- Static file service;
- HTTP/HTTPS reverse proxy;
- Load balancing;
- TLS termination;
- Content caching;
- HTTP/2, HTTP/3, QUIC;
- TCP/UDP proxy;
- Mail agent;
- Gateway layer current limiting, compression, and header processing.
Its advantages are maturity, stability, good performance, and wide ecology. The disadvantage is that strong configuration capabilities also mean that it is easy to write chaos, especially multi-layer proxies, path rewriting and caching rules.
Who is suitable for viewing source code or warehouse?
Ordinary users do not necessarily need to read the source code, but the official repository is suitable for:
- Want to know the progress of NGINX development;
- Track HTTP/3, QUIC, TLS related capabilities;
- Troubleshoot module behavior;
- Research on high-performance C network servers;
- Conduct security and version audits;
- Need to confirm whether a certain configuration behavior conforms to the implementation.
For daily deployment, it is better to give priority to official documents and release package instructions, and do not just focus on GitHub master.
Usage suggestions
When actually using NGINX, several habits are important:
- The configuration is clearly split, do not cram one file into the bottom;
- HTTPS, HSTS, forwarding headers and real IP must be configured correctly;
- The reverse proxy timeout and upload size should be adjusted according to the business;
- First
nginx -tafter modifying the configuration; - Cooperate with log positioning 4xx / 5xx;
- Do not expose the management backend to the public network casually.
Summary
NGINX is the kind of infrastructure that’s not fancy but is critical. It not only “can run the website”, but also undertakes a large part of the work of inlet traffic management, proxy, security and performance optimization.
If you are doing web service deployment, NGINX is still worth learning systematically.