Skip to content

Instantly share code, notes, and snippets.

@nginx-gists
nginx-gists / app.go
Created August 11, 2020 01:17
Application Isolation with NGINX Unit
package main
import (
"encoding/json"
"fmt"
"net/http"
"unit.nginx.org/go"
"os"
"strconv"
)
@nginx-gists
nginx-gists / ubuntu_install.sh
Last active May 29, 2025 05:42
Automating Installation of WordPress with NGINX Unit on Ubuntu
#!/usr/bin/env bash
if [ "$EUID" -ne 0 ];then
>&2 echo "This script requires root level access to run"
exit 1
fi
if [ -z "${WORDPRESS_DB_PASSWORD}" ]; then
>&2 echo "WORDPRESS_DB_PASSWORD must be set"
>&2 echo "Here is a random one that you can paste:"
@nginx-gists
nginx-gists / cache_manager_min_free.conf
Last active November 11, 2022 00:06
Announcing NGINX Plus R23
proxy_cache_path /var/cache/nginx keys_zone=cache_zone:10m min_free=100M;
server {
#...
location / {
proxy_pass http://backend;
proxy_cache cache_zone;
proxy_cache_key $uri;
}
}
@nginx-gists
nginx-gists / cookie_flags.conf
Last active November 11, 2022 00:07
Announcing NGINX Plus R24
@nginx-gists
nginx-gists / bash.yaml
Last active November 11, 2022 00:08
How to Simplify Kubernetes Ingress and Egress Traffic Management
apiVersion: apps/v1
kind: Deployment
metadata:
name: bash
spec:
replicas: 1
selector:
matchLabels:
app: bash
template:
@nginx-gists
nginx-gists / Dockerfile
Last active June 17, 2025 07:20
Our Roadmap for QUIC and HTTP3 Support in NGINX
# Builds NGINX from the QUIC+HTTP/3 development branch
# - Based on the official NGINX docker image, including all modules built by default
# - OpenSSL replaced with LibreSSL to support QUIC's TLS requirements (statically linked)
#
# docker build --no-cache -t nginx:quic .
# docker run -d -p 443:443 -p 443:443/udp nginx:quic
#
# Note that a suitable configuration file and TLS certificates are required for testing!
# See <https://quic.nginx.org/readme.html> for more info
@nginx-gists
nginx-gists / dashboard.conf
Last active November 11, 2022 00:09
Scaling MySQL with TCP Load Balancing and Galera Cluster
server {
listen 8080;
location /api { # Enable JSON status API
write=on;
}
location = /dashboard.html {
root /usr/share/nginx/html;
}
@nginx-gists
nginx-gists / nginx.conf
Created July 27, 2021 23:13
Announcing NGINX Plus R11
load_module modules/ngx_http_geoip2_module.so;
@nginx-gists
nginx-gists / chroot
Created August 13, 2021 00:14
Updates to NGINX Unit for Summer 2021
{
"action": {
"share": "/www/data/static/",
"chroot": "/www/data/"
}
}
@nginx-gists
nginx-gists / app-virtual-server.yaml
Created August 13, 2021 22:12
Deploying NGINX Ingress Controller on Amazon EKS: How We Tested
apiVersion: k8s.nginx.org/v1
kind: VirtualServer
metadata:
name: app-ingress
spec:
host: app.example.com
tls:
secret: app-secret-ecc
upstreams:
- name: web-server-payload