- 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 hidden or 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 hidden or 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
events { worker_connections 2014; } | |
http { | |
default_type text/plain; | |
log_format cookie '$cookie_route - $route_cookie, ' | |
'$request_uri - $route_uri, ' | |
'$route - $upstream_addr'; | |
error_log /var/log/nginx/debug_error.log debug; |
This file contains hidden or 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 info; | |
pid /var/run/nginx.pid; | |
events { worker_connections 1024; } | |
http { | |
default_type text/html; | |
log_format main '$remote_addr -> $request $status $body_bytes_sent bytes -> $upstream_addr'; | |
access_log /var/log/nginx/access.log main; |
This file contains hidden or 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 hidden or 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 hidden or 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 8080; | |
server_name localhost example.com *.example.com; | |
location / { | |
return 301 /status.html; | |
} | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { |
This file contains hidden or 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 hidden or 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 hidden or 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 / { |