Basic tutorial of nginx that demonstrates primary nginx capabilities
Capability | Demo |
---|---|
Basic | 0-base.conf |
Static Serving | 1-static.conf |
Rewrite / redirect | 2-redir.conf |
Reverse proxy | 3-proxy.conf |
Load balance | 4-lb.conf |
Compress | 5-compress.conf |
Cache | 6-cache.conf |
- Install nginx to a folder using
nginx-src/build.sh
- Execute the driver script:
$> python3 -m venv venv
$> source venv/bin/activate
$> pip install -r requirements.txt
$> python driver.py
curl -v localhost:8080
curl -v localhost:8080/specific/url?someparam=123
curl -v -H 'Host: foo.local' localhost:8080
curl -v -H 'Host: bar.local' localhost:8080
curl -v -H 'Host: example.com' localhost:8080
curl -I localhost:8080/tslogo.png
curl -i localhost:8080/gpl.txt | less
curl -v -H 'Host: foo.local' localhost:8080/some/path?someparam=123
curl -v -H 'Host: foo2.local' localhost:8080/somepath
curl -v -H 'Host: foo2.local' localhost:8080/search?someparam=123
curl -v -H 'Host: bar.local' localhost:8080/user/123
curl -v -H 'Host: bar2.local' localhost:8080/user/123
# start nodejs server from backends directory
backends/run-backends.sh
curl -v localhost:8080/login
curl -v localhost:8080/someotherpath
curl -v localhost:8080/path
curl -s -v -H 'Host: foo.local' localhost:8080/gpl.txt --output /dev/null
curl -s -v -H 'Host: bar.local' localhost:8080/gpl.txt --output /dev/null
curl -s -v -H 'Host: bar.local' -H 'Accept-Encoding: gzip' localhost:8080/gpl.txt --output /dev/null
curl -s -v localhost:8080/gpl.txt --output /dev/null
curl -s -v localhost:8080/tslogo.png --output /dev/null