Skip to content

Instantly share code, notes, and snippets.

@tonsV2
Created August 21, 2010 23:11
Show Gist options
  • Save tonsV2/543000 to your computer and use it in GitHub Desktop.
Save tonsV2/543000 to your computer and use it in GitHub Desktop.
#! /bin/bash
if [ -z "$2" ]; then
echo “Usage: $0 domain_name ip[:port]“
exit
fi
#create cert
./create_cert $1
conf="
server {
listen 443;
server_name $1;
access_log /var/log/nginx/proxy.$1.log;
ssl on;
ssl_certificate ssl/$1.crt;
ssl_certificate_key ssl/$1.key;
location / {
# auth_basic \”Restricted\”;
# auth_basic_user_file auth/$1.htpasswd;
proxy_pass http://$2;
proxy_redirect off;
include proxy.conf;
}
}"
echo “$conf” > $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment