Skip to content

Instantly share code, notes, and snippets.

@nginx-gists
nginx-gists / api.conf
Last active November 11, 2022 00:13
Over-the-Air Updates to IoT Devices with NGINX
log_format api_main '$remote_addr - $remote_user [$time_local] "$request"'
'$status $body_bytes_sent "$http_referer" "$http_user_agent"';
server {
access_log /var/log/nginx/api_access.log api_main;
listen 443;
server_name <domain-url>;
location /ota {
@nginx-gists
nginx-gists / dual_stack_certificates.conf
Last active November 11, 2022 00:12
Announcing NGINX Plus R10
server {
listen 443 ssl;
server_name example.com;
ssl_certificate example.com.rsa.crt;
ssl_certificate_key example.com.rsa.key;
ssl_certificate example.com.ecdsa.crt;
ssl_certificate_key example.com.ecdsa.key;
}
@nginx-gists
nginx-gists / app-virtual-server.yaml
Last active November 11, 2022 00:12
Comparing NGINX Performance in Bare Metal and Virtual Environments: 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
@nginx-gists
nginx-gists / hc_persistent.conf
Last active November 11, 2022 00:11
Announcing NGINX Plus R25
stream {
upstream backend {
zone backend 64k;
resolver 10.0.0.53;
server time.example.com:37 resolve;
}
server {
listen 37;
proxy_pass backend;
@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
@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 / nginx.conf
Created July 27, 2021 23:13
Announcing NGINX Plus R11
load_module modules/ngx_http_geoip2_module.so;
@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 / Dockerfile
Last active September 22, 2024 05:55
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 / 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: