Skip to content

Commit

Permalink
Add 'users/proxy/' from commit 'a4b8aa6329e77dee92d8fc2bcbfa7c906d40b…
Browse files Browse the repository at this point in the history
…dd8'

git-subtree-dir: users/proxy
git-subtree-mainline: a789f1f
git-subtree-split: a4b8aa6
  • Loading branch information
lloyd committed Sep 21, 2013
2 parents a789f1f + a4b8aa6 commit ee259ca
Show file tree
Hide file tree
Showing 13 changed files with 102 additions and 0 deletions.
9 changes: 9 additions & 0 deletions users/proxy/.bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

# User specific aliases and functions
export PATH=$PATH:/usr/local/bin:$HOME/node_modules/.bin
12 changes: 12 additions & 0 deletions users/proxy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/node_modules
/code
/code.old
/config.json
/ver.txt
/.*
!/.bashrc
!/.gitignore
/git
/key.pem
/cert.pem
*~
1 change: 1 addition & 0 deletions users/proxy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
the files for the proxy user's home directory live here.
31 changes: 31 additions & 0 deletions users/proxy/conf.d/common.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# serve ver.txt
location /ver.txt {
root /home/app;
}

# server awbox page
error_page 502 /500/;
location /500/ {
root /home/app/;
}
location /awsbox_background.jpg {
root /home/app/500;
}

# router
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;

proxy_pass http://127.0.0.1:10000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";

gzip on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
gzip_proxied any;
gzip_types application/javascript text/css;
}
5 changes: 5 additions & 0 deletions users/proxy/conf.d/http.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
server {
listen 80;
include /home/proxy/conf.d/server_name.inc;
include /home/proxy/conf.d/common.inc;
}
8 changes: 8 additions & 0 deletions users/proxy/conf.d/https.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
server {
listen 443 ssl;
# Self-signed certificate.
ssl_certificate /home/proxy/cert.pem;
ssl_certificate_key /home/proxy/key.pem;
include /home/proxy/conf.d/server_name.inc;
include /home/proxy/conf.d/common.inc;
}
1 change: 1 addition & 0 deletions users/proxy/conf.d/server_name.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
server_name "";
5 changes: 5 additions & 0 deletions users/proxy/gen_self_signed.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

openssl genrsa -out key.pem 2048
openssl req -new -config request.cnf -x509 -key key.pem -out cert.pem -days 1095

10 changes: 10 additions & 0 deletions users/proxy/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "awsbox-proxy",
"version": "0.0.1",
"private": true,
"dependencies": {
"connect": "2",
"http-proxy": "0.10.3",
"forever": "0.10.8"
}
}
14 changes: 14 additions & 0 deletions users/proxy/request.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[ req ]
default_bits = 2048
default_keyfile = key.pem
distinguished_name = AWSBOX deployment
prompt = no

[ AWSBOX deployment ]
C = US
ST = Test State or Province
L = Test Locality
O = Organization Name
OU = Organizational Unit Name
CN = awsbox.tld
emailAddress = [email protected]
2 changes: 2 additions & 0 deletions users/proxy/var/log/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
2 changes: 2 additions & 0 deletions users/proxy/var/log/nginx/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
2 changes: 2 additions & 0 deletions users/proxy/var/run/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore

0 comments on commit ee259ca

Please sign in to comment.