2020-05-13 14:37:30 +00:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
|
|
|
nginx_config_dir="/etc/nginx/conf.d"
|
|
|
|
domain="$__object_id"
|
|
|
|
|
|
|
|
__directory /var/www/html/$domain \
|
|
|
|
--parents --mode 0644
|
|
|
|
|
|
|
|
require="__directory//var/www/html/$domain" \
|
|
|
|
__file /var/www/html/$domain/index.html \
|
|
|
|
--source - --mode 0644 << EOF
|
|
|
|
Hello Cdist!!!
|
|
|
|
EOF
|
|
|
|
|
|
|
|
__my_nginx
|
|
|
|
|
|
|
|
# configure nginx
|
|
|
|
require="__my_nginx" \
|
|
|
|
__file "$nginx_config_dir/${domain}.conf" \
|
|
|
|
--mode 0644 --source - << EOF
|
|
|
|
server {
|
|
|
|
listen 80;
|
|
|
|
listen [::]:80;
|
|
|
|
|
2020-05-13 15:02:17 +00:00
|
|
|
server_name $domain;
|
2020-05-13 14:37:30 +00:00
|
|
|
|
|
|
|
access_log /var/log/nginx/access.log;
|
|
|
|
|
|
|
|
client_max_body_size 256m;
|
|
|
|
|
|
|
|
location / {
|
|
|
|
root /var/www/html/$domain;
|
|
|
|
index index.html index.htm;
|
|
|
|
}
|
|
|
|
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
|
|
|
|
|
|
location = /50x.html {
|
|
|
|
root /var/www/html/$domain;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
EOF
|