linuxinfrastructure
Nginx
nginxlinuxservices
Plain English
Nginx is software that serves websites. It can also stand in front of other apps and pass visitors through to them.
Technical Definition
nginx (engine-x) uses an event-driven model to handle many connections.
- Config: /etc/nginx/nginx.conf, sites in /etc/nginx/sites-available, enabled by symlink into sites-enabled.
- server blocks pick a site by port and name; location blocks match paths.
- proxy_pass makes it a reverse proxy.
- nginx -t tests config; systemctl reload nginx applies.
- Logs in /var/log/nginx/.
Source: nginx docs
Nginx in practice
$ sudo nginx -t
nginx: configuration file /etc/nginx/nginx.conf test is successful
$ sudo systemctl reload nginxIn the Wild
Nginx fronts a big share of the web. In BNLC Phase 8 it serves your page and proxies a Docker app bound to loopback.