Skip to content

Instantly share code, notes, and snippets.

@nginx-gists
nginx-gists / app-virtual-server.yaml
Created Aug 13, 2021
Deploying NGINX Ingress Controller on Amazon EKS: How We Tested
View app-virtual-server.yaml
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
@nginx-gists
nginx-gists / chroot
Created Aug 13, 2021
Updates to NGINX Unit for Summer 2021
View chroot
{
"action": {
"share": "/www/data/static/",
"chroot": "/www/data/"
}
}
@nginx-gists
nginx-gists / nginx.conf
Created Jul 27, 2021
Announcing NGINX Plus R11
View nginx.conf
load_module modules/ngx_http_geoip2_module.so;
@nginx-gists
nginx-gists / dashboard.conf
Last active Jul 27, 2021
Scaling MySQL with TCP Load Balancing and Galera Cluster
View dashboard.conf
server {
listen 8080;
location /api { # Enable JSON status API
write=on;
}
location = /dashboard.html {
root /usr/share/nginx/html;
}
@nginx-gists
nginx-gists / Dockerfile
Created Jul 9, 2021
Our Roadmap for QUIC and HTTP3 Support in NGINX
View Dockerfile
FROM nginx AS build
WORKDIR /src
RUN apt-get update && \
apt-get install -y git gcc make g++ cmake perl libunwind-dev golang && \
git clone https://boringssl.googlesource.com/boringssl && \
mkdir boringssl/build && \
cd boringssl/build && \
cmake .. && \
make
@nginx-gists
nginx-gists / bash.yaml
Last active Jun 28, 2021
How to Simplify Kubernetes Ingress and Egress Traffic Management
View bash.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: bash
spec:
replicas: 1
selector:
matchLabels:
app: bash
template:
@nginx-gists
nginx-gists / cookie_flags.conf
Last active May 6, 2021
Announcing NGINX Plus R24
View cookie_flags.conf
View cache_manager_min_free.conf
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 / ubuntu_install.sh
Last active Jul 31, 2021
Automating Installation of WordPress with NGINX Unit on Ubuntu
View ubuntu_install.sh
#!/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 / app.go
Created Aug 11, 2020
Application Isolation with NGINX Unit
View app.go
package main
import (
"encoding/json"
"fmt"
"net/http"
"unit.nginx.org/go"
"os"
"strconv"
)