- NGINX Plus repo setup and install instructions (https://cs.nginx.com/repo_setup)
- NGINX Open Source install instructions (http://nginx.org/en/docs/install.html)
- NGINX syntax highlighting in vim (https://gist.github.com/kmjones1979/e3580525801254844e3b3f57989cbd38)
- NGINX command line switches (https://nginx.org/en/docs/switches.html)
- NGINX directives index (http://nginx.org/en/docs/dirindex.html)
- NGINX variables index (http://nginx.org/en/docs/varindex.html)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"errors" | |
"fmt" | |
"github.com/cactus/go-statsd-client/statsd" | |
"io/ioutil" | |
"log" | |
"net/http" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http { | |
geo $subnet { | |
default 0; | |
45.55.0.0/24 1; | |
} | |
map $subnet $value { | |
default ""; | |
1 $remote_addr; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user nginx; | |
worker_processes auto; | |
error_log /var/log/nginx/error.log notice; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user nginx; | |
worker_processes auto; | |
error_log /var/log/nginx/error.log notice; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import csv | |
# zip code api variables | |
API_URL = 'http://www.mapquestapi.com/directions/v2/route' | |
KEY = 'SECRET' | |
DEST = 'ZIP_CODE_HERE' | |
# csv variables | |
FILE = '/path/to/geo_zip.csv' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
wget -O nginx.vim http://www.vim.org/scripts/download_script.php\?src_id\=19394 | |
mkdir -p ~/.vim/syntax | |
mv nginx.vim ~/.vim/syntax/ | |
echo "au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/conf/* if &ft == '' | setfiletype nginx | endif" | tee -a ~/.vim/filetype.vim |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 8001; | |
listen 8002; | |
server_name example.com *.example.com; | |
status_zone backend_800X; | |
location / { | |
return 200 "This is a server listening on $server_addr:$server_port \n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name example.com *.example.com; | |
status_zone example_com_80; | |
location / { | |
proxy_pass http://backend; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
server_name _; | |
status_zone example.com_80; | |
location / { |
OlderNewer