-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.yml
77 lines (74 loc) · 2.13 KB
/
nginx.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
name: nginx
releases:
- name: nginx
version: latest
stemcells:
- alias: ubuntu
os: ubuntu-trusty
version: latest
instance_groups:
- name: nginx
instances: 1
azs: [ z1 ]
vm_type: default
persistent_disk_type: default
stemcell: ubuntu
networks:
- name: default
static_ips: [ 10.244.0.34 ]
jobs:
- name: nginx
release: nginx
properties:
nginx_conf: |
user nobody vcap; # group vcap can read most directories
worker_processes 1;
error_log /var/vcap/sys/log/nginx/error.log info;
events {
worker_connections 1024;
}
http {
include /var/vcap/packages/nginx/conf/mime.types;
default_type application/octet-stream;
sendfile on;
ssi on;
keepalive_timeout 65;
server_names_hash_bucket_size 64;
server {
server_name _; # invalid value which will never trigger on a real hostname.
listen *:80;
# FIXME: replace all occurrences of 'example.com' with your server's FQDN
access_log /var/vcap/sys/log/nginx/example.com-access.log;
error_log /var/vcap/sys/log/nginx/example.com-error.log;
root /var/vcap/data/nginx/document_root;
index index.shtml;
auth_basic "Please type your password!";
auth_basic_user_file /var/vcap/data/nginx/htpasswd.conf;
}
}
pre_start: |
#!/bin/bash -ex
NGINX_DIR=/var/vcap/data/nginx/document_root
USER=admin
PASS="avarteq;123"
echo "${USER}:$(echo "${PASS}" | openssl passwd -apr1 -stdin)" >/var/vcap/data/nginx/htpasswd.conf
if [ ! -d $NGINX_DIR ]; then
mkdir -p $NGINX_DIR
cd $NGINX_DIR
cat > index.shtml <<EOF
<html><head><title>Bosh Nginx</title>
</head><body>
<h2>Welcome Avarteq!</h2>
<h2>
Churs Bro!
</h2>
</body></html>
EOF
fi
update:
canaries: 1
max_in_flight: 1
serial: false
canary_watch_time: 1000-60000
update_watch_time: 1000-60000