Skip to content

Instantly share code, notes, and snippets.

View vnykmshr's full-sized avatar

Vinayak Mishra vnykmshr

View GitHub Profile
@qzaidi
qzaidi / nginx.conf
Created February 20, 2014 10:49
stacked nginx
recursive_error_pages on;
location / {
try_files $uri @nodesrv;
}
location @nodesrv {
proxy_pass http://localhost:5000;
proxy_intercept_errors on;
error_page 404 = @phpsrv;
}
@progrium
progrium / gist:5734609
Last active October 14, 2019 07:15
Let unprivileged processes easily restart/reload Nginx without sudo or setuid hacks
# run this as root
while [ 1 ]; do echo | nc -l -U /tmp/reload_nginx && /etc/init.d/nginx reload; done
# or as an upstart job
script
echo | nc -l -U /tmp/reload_nginx && /etc/init.d/nginx reload
end script
respawn
# now any process can run this or do the equivalent with sockets to trigger reload
@jessedearing
jessedearing / gist:2351836
Created April 10, 2012 14:44 — forked from twoism-dev/gist:1183437
Create self-signed SSL certificate for Nginx
#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key