Created
August 21, 2010 23:11
-
-
Save tonsV2/543000 to your computer and use it in GitHub Desktop.
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 | |
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